Possible Duplicate:
caching JavaScript files
I’m using JQuery 1.7.2 into JSF page. I call several times jquery-1.7.2.min.js into the body of the page. In general is it possible to configure the web browser to download the library only once and use it instead of downloading it every time?
Use localStorage then when the page loads check if jQuery is stored in local cache if not then create ajax request save to localStorage and append into script header.
If client again visit page just load from localstorage into html
+ failback load jQuery standard
But need use pure JavaScript code
Code:
Download jQuery only one time per few years:
https://gist.github.com/3844878