1

I have a basic HTML page, no dynamic content. Occassional updates done manually. However, I am having reports that people are seeing old versions of the page. I thought I had all "no caching" headers setup on my page, under the <head> section of the html document.

  <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
  <meta http-equiv="EXPIRES" content="0" />
  <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

Any idea what else I can do to force client-side refresh? The site is being service by apache.

UPDATE So, it turns out this was really just user error. The person experiencing these problems was looking for updates on a.domain.com, but had instructed me to make the changes on b.domain.com. So they were, simply, looking in the wrong place. I did learn some things about caching though, while trying to figure out the problem!

CoolUserName
  • 3,715
  • 6
  • 26
  • 30
  • I've been under the impression that the only foolproof way to do this is set these headers in the response (on the server-side). However, this SO post seems to suggests otherwise: http://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off-caching-in-all-browsers – Kevin Boucher Oct 29 '12 at 19:39
  • 1
    Those meta tags set the caching instructions for your *page*, but not the *image* – Pekka Oct 29 '12 at 19:39
  • 1
    @Pekka I'm confused, what image? – CoolUserName Oct 29 '12 at 19:43
  • @Cool sorry, I totally misread your post, I thought this was about an image inside that page – Pekka Oct 29 '12 at 19:50
  • @Pekka sorry wasn't specific. The caching I'm observing is the actual HTML content. – CoolUserName Oct 29 '12 at 19:54
  • 1
    This article is well worth a read. http://www.mnot.net/cache_docs/ Written by Mark Nottingham, the chair of the IETF HTTPbis Working Group which is responsible for improving HTTP. – Alohci Oct 30 '12 at 00:52

2 Answers2

1

The users' browser may have it's own cache settings. As well, the server sending your HTML file may be adding it's own cache-control headers, etc. There are many layers and things that can interact or over-ride each-other when it comes to static caching.

anonymous coward
  • 12,594
  • 13
  • 55
  • 97
1

It may be proxies that cache the content. Trying to prevent cache in the HTML headers may not prevent all caching. Using HTTP header expiration should help.

You can use mod_expires and mod_headers to disable caching...

http://www.electrictoolbox.com/apache-mod-expires-browser-caching/

http://www.helicontech.com/ape/doc/mod_headers.htm

http://drupal.org/node/32109

PressingOnAlways
  • 11,948
  • 6
  • 32
  • 59