Call (877) SITE-OPT (748-3678)

Code: No caching headers

Chapter 8 - Ajax Optimization

You can easily keep the browser from caching requests by emitting headers on the server. In PHP, you would use statements such as these:

header("Cache-Control: no-cache");
header("Pragma: no-cache");

There are many choices, and servers can be quite loquacious in the kinds of headers they stamp on a response to avoid caching. For example, you might set some headers to really let caches know that you mean business:

Expires: Wed, 18 Nov 1981 09:12:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Copyright © 2002-2018 Website Optimization, LLC. All Rights Reserved - Free website speed test - Privacy Policy
Last modified: February 19, 2009.

Follow us on: Twitter, Google+, Facebook, Linked In