I'm using a lot of frameworks in my website (Knockout
, bootstrap
, jquery
, jquery ui
etc) which is causing it to load slow. Is it a good practice to store these javascript files (ex knockout.js
) and associated CSS files(ex bootstrap.css
) in Application cache. I looked in my browser's application cache and most of them store sprites, yet to come across JS caching
Asked
Active
Viewed 201 times
0

Kalyan
- 1,395
- 2
- 13
- 26

user1938419
- 3
- 3
1 Answers
0
using applicationCache won't improve the load time for your application, that's what cache headers are for. Best practice here is to
- concatenate and compress all your assets
- change the filenames of the assets, for example add a hash based on their contents, so app.js becomes app.abc456.js
- Set cache headers to cache these assets for ever. As the file names change each time, you won't have any problems with it.
"The applicationCache is a douchebag": http://alistapart.com/article/application-cache-is-a-douchebag
Unless you have to make your app work offline, trust me, it's not worth it.

Gregor
- 2,325
- 17
- 27