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'm using the following header on a php page.

 // Prevent page caching.
 header('Expires: Tue, 20 Oct 1981 05:00:00 GMT'); 
 header('Cache-Control: no-store, no-cache, must-revalidate'); 
 header('Cache-Control: post-check=0, pre-check=0', FALSE); 
 header('Pragma: no-cache');

I'm also using a rand=999999999 (with a real random number) in the URLs.

But pages are still being cached. Reload works, but first load is cached. Anyone know where I can change this?

share|improve this question

migrated from superuser.com Sep 21 '10 at 21:17

This question came from our site for computer enthusiasts and power users.

2 Answers 2

You send a duplicate "Cache-Control" header. Try removing the second one.

share|improve this answer

Check NGINX settings. Might be there something like

proxy_ignore_headers  "Cache-Control" "Expires";
share|improve this answer

Your Answer

 
discard

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