tags:

views:

26

answers:

1

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?

A: 

Your problem is most probably some combination of the browser, the operating system and the proxy you are using. Therefore...

a) Stop using IE to test a web application until you know your application works 100% in at least two decent browsers that actually try to adhere to standards. FF has good dev tools and is recommended.

b) Reboot windows and clear your cache. Set up FF to check every visit. Disable any local proxy for the test site. Now test. Get that working. Check the logs on the server to prove that caching took place. If it was served, it wasn't cached.

c) Then try testing with IE. Fix the layout (without breaking it for decent browsers). Fix the javascript errors that have appeared with IE (again without breaking for other browsers). Fix everythgin else that is wrong in IE - all without breaking the working code. (Stop cursing MS - its not good for your health).

d) Leave the remaining bugs for IE users - some bugs in IE cannot be got round.:(

OK - I'll admit to guessing a bit about the reasons for your trouble. Had the same sort of trouble with windows and IE. The above is a practical solution.

p.s. I've used nginx and fastcgi for over 2 years. Never had any problems.

Ian