HTML5 localStorage for assets (stylesheets, JavaScript, images etc)
Posted
by Sam
on Stack Overflow
See other posts from Stack Overflow
or by Sam
Published on 2010-01-26T11:29:54Z
Indexed on
2010/06/06
14:12 UTC
Read the original article
Hit count: 161
html5
|localstorage
To save both client download time and network usage, is it possible to use the localStorage feature of HTML5 to store contents of linked stylesheets, javascript files and binary data (e.g. images), rather than hitting the server each time?
Would that just complicate things - since I assume you would have to add the linked asset via JavaScript rather than just a script
or link
element, breaking the page for those without JavaScript enabled)? Unless you can parse the content (using HEAD
requested to check last modified date and other headers) before the browser downloads it.
Or best just to stick with 304 Not Modified
and eTag
headers?
© Stack Overflow or respective owner