Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm experiencing a caching issue I can't explain. This is happening across browsers, IPs and ISPs. If a user force-refreshes, they see the new content. If they then refresh or return to the page, the old one displays. I've tried using headers via PHP such as

header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );

Laid out correctly, at the very beginning of the file. The problem persists. A pan-ISP proxy is unlikely. Suggestions?

share|improve this question

1 Answer 1

If your server is sitting behind a reverse-proxy, application firewall, or other type of network device, it may provide it's own caching mechanism and rewrite some of the HTTP headers being sent from your server.

You can use the Live HTTP Headers Firefox plugin from a remote connection to judge exactly what's being received by an outside visitor.

You can also try overriding the HTTP headers sent by including the cache control value in a meta tag inside the <head> of the document:

<meta http-equiv="Cache-Control" content="no-cache">

You could list other headers in this fashion as well, with one tag per header value.

share|improve this answer

Your Answer

 
discard

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