HTML5 Storage made easy
I’ve been looking for a good lib that’ll allow me to use HTML5 like storage in a project right now. I’ve found there are a number of them out there. I believe that browser storage is a new tech tool at our disposal that’ll make writing browser apps both cleaner and easier. Synchronizing data from the “cloud” into an app’s browser storage will be a likely requirement in heavy browser side apps. Already I’m pretty stoked about the possibilities: caching in process video/image editing, storing music, movies or games that can be played offline, or maybe keeping google docs offline but still editable.
I’ve found two libraries I’d use; first there is a nice lib called Real Storage which when used will provide a singular storage api between the numerous browsers. This is helpful since so far the many browsers have little glitches and/or differences which make writing an app using storage a bit tricky. Real Storage will smooth things over without adding too much complexity. If you want to be close to the bare metal give this a try. If your are looking for something a bit more helpful to get things done then this next lib is for you.
Lawnchair is very cool. It acts as a very simple key value store. One of the smartest features is that it can degrade all the way down to using cookies, so that if you are doing small bits of storage it’ll suffice for projects needing to worry about old school browsers such as IE 6, FF 2 and the like.
Please visit the Lawnchair site and open up your Firebug, Safari or Chrome console. From there you can play with Lawnchair, as it is loaded across the site. I suggest following the mini-tutorial on the site. After that dropping it into your site should be a snap. Note that Lawnchair is broken up into a number of files, as you can see by opening the HTML browser for the site. If you aren’t going to need to support certain older browsers, or Google gears, etc then you don’t have to load those adapter files.
I’m pleased with what I’ve found so far. Already there are people gearing up for these new HTML5 features to become commonplace, and they are building the tools that’ll better leverage these technologies. Already I’m hoping to see these libs get some security based features, so you can have encrypted offline data (so maybe I can have my banking info always available). It’s easy to imagine what the future holds, but I’m sure there are going to be some really good surprises that come out of these new tools and I can’t wait!