The idea is to make use of HTML5 local storage to store frequently accessed CSS and JavaScript.For example (pseudo-code):var load_from_cdn = true;if (detect local storage)  {  if (cache of css, js found)  {     load the local storage cache     load_from_cdn = false;  }}if (load_from_cdn){   document.write('<script>...');}Is this possible or realistic?  I do aware browser cache, there will be still some header access checking,I assuming no HTTP access is better (in my thinking)PS : It seems that local storage only support key-value pair, can someone prove it ?(best with some examples)
is it realistic to make use of HTML5 local storage to store CSS, and JavaScript
html5;optimization
It is absolutely OK to use local storage to store JS and CSS. However, local storage has 5M per domain limitation. You might have to reconsider this strategy. For desktop web, you can leverage default browser cache to do the trick. Just set the JS & CSS HTTP response to be cacheable. It is simple and easy.For mobile web, latency is high. So, reducing HTTP requests is critical. So, having JS & CSS in external URL's is optimal. It would be much better to have JS & CSS inline. This reduce HTTP requests, but bloated the HTML content. Then What? Just as you said, use local storage!When one browser visits the site for the first time, JS & CSS are put inline. The JS also has two more jobs:1) Store JS & CSS into local storage;2) Set cookie to flag that JS & CSS are in local storage.When the browser access the site for the second time, server got the cookie and know that the browser already have related JS & CSS. So the render HTML has inline JS to read JS & CSS from local storage and insert into DOM tree.This is basic idea how bing.com mobile version is created. You may need to put JS&CSS version control into consideration when implement it in production.Thanks