Question

Check this picture: http://i54.tinypic.com/2gy7mrt.png

How to achieve that for my static files? I mean so the browser even wouldn't make a request to server, just take the file from cache. On what static files should this method be used?

Was it helpful?

Solution

Assuming your server is Apache, have a look at mod_expire.

The static files I have configured to expire "later" are text/css, text/javascript, application/javascript and image/*.

OTHER TIPS

Send 304 Not Modified header.

I would use it on anything that is unlikely to change often - your site's logo, sprite image, etc.

If you have sent far distant expiry headers, and then decided you need to change the asset, simply append a time stamp / release, e.g. sprites.png?4000.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top