Wrapping Things Nicely with HTML5 Local Storage
13 Comments
Comments are ordered by helpfulness, as indicated by you. Help us pick out the gems and discourage asshattery by voting on notable comments.
Got something to add? You can leave a comment below.
Steerpike
Andy Webber
Great article Christian! It is indeed an exciting time for web technologies and this is an important step in the movement from standalone software to web based computing.
cancel bubble
“On the web, there is also a lot of work going on, with Ian Hickson of Google proposing the Web SQL database,”
Web SQL DB is listed as “stalled” on the WHATWG wiki, http://wiki.whatwg.org/wiki/FAQ
Patrick Campbell
Nice article, thanks! A lot to get my head around.
UVL
The very last lines of the article about Storing the JS and UI images really unlighted me.
I was wondering if the HTML5 “App Cache” (any article about it?) could help, but this looks like a good solution anyway.
Nice article, as usual.
The only “not so good” part, for me, is relying on the user using the same device for each visit to the site and storing state and/or user data in the browser and not in the server. This means that if you access the site from a different device you may not have all your data/preferences available.
As I said, it’s a great article, this are just my 2 cents.
Nicolas Chevallier
I agree to save any state or user preferences or offline data… But why save files css, js or html, so that finally we can do exactly the same thing for years with expires headers?
Charlie Park
Thanks for this piece, Christian. I’ve seen tons of vague references to local storage, and it’s great to read a piece that can explain it well. But …
I agree with José, that it seems like relying on local storage hamstrings much of what makes web apps useful. Is there a way to get the benefits of local storage while sending the data in the background to an offsite database? That way you’d get the speed benefits of local storage while getting the “accessible anywhere” benefits of offsite storage.
Mandataire auto
That’s a great post, but there is something that I can’t understand yet : such a local storage is great for some services like mail service, calendar etc. that can be use only with one computer.
I think about risks and hacking with this kind of solution : if the developper try to store passwords so that the user don’t have to put it next times, that will give a possibility to hackers to find some informations, I think. Don’t you think so ?
gines
Christian Heilmann thank you for this excellent article full of information. Ive learned a lot. It seems a pity that space is limited to 5MB. I look forward to 2020 where the space will be 1000GB … no wait, or will it never happen? :D
Andy Walpole
I’ve just followed this guide and given it a go. I achieved what I wanted to do in 30 minutes – it was far easier to implement than JavaScript cookies.
Just make sure you use Modernizr in a conditional statement and away you go!
Luke L
Web SQL is actually no longer maintained as it was just a wrapper around SQLite, so using it is going to cause big problems further down the line.
http://www.w3.org/TR/webdatabase/
And for storing files etc, you’re much better off making a cache manifest.
Mazilu teodor
I was wondering what will be the first article to talk about HTML5 or CSS3 this year.
Well it comes as no surprise that Christian Heilmann discuses – his job is evangelising it.
Good article. I love this new feature introduced by HTML5, it brings numerous advantages and is easy to work with.
Nice writeup as usual Christian and we’re finding localStorage really is a perfect matchup with the brilliant YQL service. We’re about to release some updates to http:open.abc.net.au at the end of the month that utilise localstorage to help cache a lot of the client-side YQL calls we’re using to get content from flickr and twitter.