Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

caching JavaScript files

Which is the best method to make the browser use cached versions of js files (from the serverside)?

like image 620
Vasil Avatar asked Nov 22 '08 08:11

Vasil


People also ask

Do JavaScript files get cached?

JavaScript and CSS files are usually cached in the browser after the first access. The browser cache is used to store web application assets like images, CSS, and JS code on your computer's hard drive.

How long does browser cache JS files?

If a user stops using the browser it is indefinitely. If he/she uses the browser rarely, it will be until the expiration - either by internal policy or by HTTP headers. If he/she uses the browser heavily, it can be 12 minutes or even less.


1 Answers

Have a look at Yahoo! tips: https://developer.yahoo.com/performance/rules.html#expires.

There are also tips by Google: https://developers.google.com/speed/docs/insights/LeverageBrowserCaching

like image 140
powtac Avatar answered Sep 18 '22 15:09

powtac