0

My web site consists of static HTML files which are usually republished once per day, and sometimes more.

I'm using Apache. In the vhost settings for my site, I'd like to tell browsers to cache HTML files indefinitely, until Apache sees that they are modified. So as soon as an HTML file is changed, Apache should immediately begin telling browsers it's changed and send the updated file. As soon as a new file is published, browsers should immediately begin receiving that...they should never receive old versions of files. Maybe

ExpiresByType text/html modification

and no "plus x days."

Is something like this possible?

Chad Johnson
  • 479
  • 2
  • 7
  • 14

1 Answers1

2

That's how it already works, you don't have to do anything (see more on Etags here: http://en.wikipedia.org/wiki/HTTP_ETag).

To be certain your ETags are working, check your Apache log and make sure you're seeing mostly 304 responses of a smaller size than the original file and that you send 200 responses after the file is changed.

You can also view response codes in browser's developer tools.

Ladadadada
  • 25,847
  • 7
  • 57
  • 90
mricon
  • 1,154
  • 7
  • 9