Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 php.in instead of a browser based solution. Thoughts?

share|improve this question
add comment

2 Answers 2

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.

Edit:

You can go here and search for "Expire" to learn more about the expire header: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

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
add comment

Your Answer

 
discard

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.