In PHP, by default no cache related headers are sent.
HTTP/1.1 200 OK
Date: Fri, 19 Nov 2010 11:02:16 GMT
Server: Apache/2.2.15 (Win32) PHP/5.2.9-2
X-Powered-By: PHP/5.2.9-2
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 26
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
Now, since by default it does not say anything about caching, can it result in say example.com/index.php getting cached in some situations?
Yes. In general, every successful response may be cached unless there are some constrains:
Unless specifically constrained by a cache-control (section 14.9) directive, a caching system MAY always store a successful response (see section 13.8) as a cache entry, MAY return it without validation if it is fresh, and MAY return it after successful validation.
Yes, usually the browser will cache certain files by default (usually images and css) if no rules have been setup on the server-side (see browser cache).
You can set up cache-control headers to control this, or disable it completely using:
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
See example #2 in header and read the note below it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With