1

I have this caching commands on my server:

# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 2 days"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType text/css "access plus 7 days"
ExpiresByType text/javascript "access plus 7 days"
ExpiresByType application/javascript "access plus 7 days"
</IfModule>
# END Expire headers

I've checked and the caching is working fine. I have Capistrano set up for deploying to server, my question is what will happen after deploy? Will the browser cache the files again because they changed the path on the server or user will have to wait for time to expire? Thanks...

anubhava
  • 761,203
  • 64
  • 569
  • 643
Wolf87
  • 540
  • 3
  • 11
  • 29

1 Answers1

1

my question is what will happen after deploy? Will the browser cache the files again because they changed the path on the server or user will have to wait for time to expire?

Unfortunately users will have to wait for browsers to expire the cached data since browsers have no way to know whether these files have changed. However if you can change the src paths of these files then browser will hit the server again and fetch a fresh copy.

anubhava
  • 761,203
  • 64
  • 569
  • 643
  • Thanks for answer. What is better to use: eTag or LastModified to force browser to cache again? Or what you've mentioned - URL fingerprinting? Thanks again... – Wolf87 Nov 01 '13 at 09:12
  • `Etag` is considered stronger, check this link: http://stackoverflow.com/questions/824152/what-takes-precedence-the-etag-or-last-modified-http-header – anubhava Nov 01 '13 at 11:12