Bootup.js - cache and load static files from local storage
github.comPaul Irish made something similar. A jQuery plugin that used localStorage to cache ajax responses.
Please correct me if I'm wrong, but isn't this what the browser cache is for?
Yeah, at least for the caching part, it seems like you should let that be the browser's responsibility, and set up Expires headers/etc appropriately. But what about the offline viewing use case? What are some good solutions to that these days?
Check out this article for a great explanation of using the cache manifest http://www.alistapart.com/articles/application-cache-is-a-do...
There are quirks, sure, but it's actually designed for asset caching, unlike localStorage
I think quirks is understating it. The problem with appcache is that if you run into many of those gotchas the article lays out, it's often difficult to resolve them for previous users. For example, say you accidentally give the manifest a far-future expires (gotcha #4); users with the forever-cached appcache need to manually clear their cache in order to get things working again. And, depending on how you've structured your app, even explaining to users that they need to clear their cache could be difficult...
You really need to plan ahead carefully if you're using the appcache, which I think changes the definition from "a nice tool, with some quirks" to "a complicated feature that you have to understand completely before implementing."
With that in mind, I think bootup.js is an interesting alternative if you can work around its other deficiencies.
Warning, LGPL licensed.
Yeah, it could have been the best project ever, but the license is the first thing I look at. So I saw that then closed the page.
What are all of the implications of LGPL when use with browser javascript anyway o_0
Why would you consider that bad? GPL brings its particular baggage, but LGPL seems fairly unobtrusive to use in about anything. RMS seems to even discourage its use, even though he created it!
Looks like an open-source version of Cloudflare's Rocket Loader, but without the source file concatenation. Still, we should produce something open-source for these.
There is also a size limit of 5MB that you should be aware of.
That is the default, not the limit. In all modern browsers, this limit is either 5MB, or set to prompt when the web page requests any larger.
For localStorage? I can't find any information on that. I know this is the case for Web SQL databases. But as far as I understand, localStorage is hard coded with no chance of expansion. To make matters worse, localStorage uses strings, effectively cutting your storage a good deal.