Wolf87
Wolf87

Reputation: 540

Browser caching after deploy

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...

Upvotes: 1

Views: 164

Answers (1)

anubhava
anubhava

Reputation: 785156

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.

Upvotes: 1

Related Questions