Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a small Xampp server that I use for coding and prototyping of php sites. Every time I refresh a page I typically have made adjustments to the code of the page in the last few seconds. There is no reason for any of the content that comes from the server to be cached, and I am having problems with my work that it is caching content.

Is there an easy way in apache or php to make the default for all content served, uncached? The only thing that can see the server is my workstation since my firewall is configured to prevent outside communication, so no worries there.

I would prefer a setting in apache or instead of a browser based solution. Thoughts?

share|improve this question
up vote 1 down vote accepted

If you are using firefox, ctl-R will reload the page, and not use the cached copy... Otherwise, you can set a header using php's header() function that tells when the page will be out of date. You can set it for 5 seconds in the future when the page is generated, and that should help.


You can go here and search for "Expire" to learn more about the expire header:

share|improve this answer
Note that ZAK used a capital 'R', it must be caps for a real refresh I think. – Kyle Brandt Nov 19 '09 at 20:13
Yeah, I was hoping for something in the apache config or php.ini. Thanks though, in the future I will use the ctl-R – Tvanover Nov 19 '09 at 20:16
I was sure that ctrl-F5 or holding ctrl while hitting the reload button works too. Might want to test that theory, though. – Kzqai May 13 '10 at 20:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.