0

I'm operating a website on which the (static) content is generated once daily. This allows setting the expires setting to "modification plus 1 day". (I'm running apache with mod_expires.)

Most files on the server aren't regenerated every day. If a file isn't regenerated after a day the browser will revalidate, but no new expires header will be sent, so the browser must revalidate the file until it's regenerated, which might not happen at all.

Touching the files daily (i.e. updating their modification time) would require the browsers to redownload the files every day, instead of just revalidating it.

The best solution I see would be, to set the expires header to the next time the files will be regenerated, thus updating the expires time once daily.

Is the solution I described (or a better one) possible in apache, or possibly another webserver?

Kritzefitz
  • 113
  • 5

1 Answers1

1

Perhaps you can try this workaround for your problem include on your configuration file a file named expiration.conf

In your expiration.conf write:

Header set Expires "Tue, 28 Apr 2015 20:00:00 GMT"

And reload apache. Of course you should create your date dinamically each day.

alphamikevictor
  • 1,062
  • 6
  • 19