Rihards
Rihards

Reputation: 10349

Static files fully from cache?

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?

Upvotes: 0

Views: 160

Answers (2)

Linus Kleen
Linus Kleen

Reputation: 34632

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

Upvotes: 2

alex
alex

Reputation: 490283

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.

Upvotes: 1

Related Questions