Settings

Theme

Bootup.js - cache and load static files from local storage

github.com

44 points by quan 13 years ago · 13 comments

Reader

ushi 13 years ago

Paul Irish made something similar. A jQuery plugin that used localStorage to cache ajax responses.

https://github.com/paulirish/jquery-ajax-localstorage-cache

le_isms 13 years ago

Please correct me if I'm wrong, but isn't this what the browser cache is for?

  • dkordik 13 years ago

    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?

    • willtheperson 13 years ago

      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

      • lylepstein 13 years ago

        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.

nickporter 13 years ago

Warning, LGPL licensed.

  • dkroy 13 years ago

    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.

  • jakejake 13 years ago

    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!

itsnotvalid 13 years ago

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.

aioprisan 13 years ago

There is also a size limit of 5MB that you should be aware of.

  • solox3 13 years ago

    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.

    • city41 13 years ago

      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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection