Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Currently my website has cache controls set for javascript libraries and images, and caches them for one week. I'd like to know what best practices I should following leading up to my websites relaunch in a week. All images, javascript, css files will be replaced.

A couple of strategies I'm considering:

  1. Change the ExpiresByType to one hour for the next week, to ensure returning visitors wont have slower speeds, and then 1.5 hrs before launch, change the cache control to zero.

  2. Change the ExpiresByType to zero until launch.

  3. Remove all cache controls from the htaccess until launch, and let the browsers handle caching.

Any thoughts on the above strategies or things I haven't considered? Thanks

This is my root .htaccess. Applies to images and javasript libraries:

ExpiresActive on
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"

This resides in another sub-directory from the root. Overides the above controls and resets to zero for my custom javascript files

ExpiresActive on
ExpiresByType text/javascript "access plus 0 seconds"
ExpiresByType application/x-javascript "access plus 0 seconds"
ExpiresByType application/javascript "access plus 0 seconds"
share|improve this question

1 Answer 1

cache and server(s) location of assets is delivery speed - decentralize assets and use cloud related cache will allow for near simultaneous requests as the requests are fed by multiple sites.

IMHO, Centralizing assets on a single server is a failed concept.

share|improve this answer
    
If your concern is cache policies, consider a map related to need for updates. example taxonomy: Logos, trademarks, corporate identity are rarely undated. Other images are frequently changed requiring a cache refresh of only these assets. –  Testbench Feb 18 at 21:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.