• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

HTML5 Local Storage

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

Html 5 look really promising and have a lot of cool features for developers, reading a bit about it I came across the Local Storage, I read that is is a much better way to store data than Cookies. I have a couple of questions about it, there they go:

How does the Storage store the information? I mean, is it a physical file in the system like Cookies were?
What does it make it better than Cookies?
Is it possible to delete this data? This question goes in both directions as developer and user, I mean, is it possible to programatically delete the data and as a user can I delete local data as I am able with individual cookies?

Thanks for coming here to help us out

Cheers
 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The main advantage local storage has over cookies is that the data doesn't get sent along with each HTTP request and response, saving you many bytes in network load and improving performance. How local storage is implemented depends on the browser, Firefox sticks them all into a SQLite database as far as I'm aware. As a user, a browser should provide an interface to clear stored data for any particular site. As a developer, there's a removeItem method.
 
Ranch Hand
Posts: 547
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

I saw this response about local data in HTML5 and was kind of surprised at how it works.


Firefox sticks them all into a SQLite database as far as I'm aware.



This seems quite alarming in terms of performance .
Is is really quicker for a browser to open a database and run a query to access site specific data than to set and read a cookie ?

Thanks,
Paul
 
Rob Crowther
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I doubt it, Firefox stores nearly everything in SQLite databases, including cookies I think. If filesytems were faster than databases, what would be the point of databases?

At this point I should make sure you're aware: I'm not an expert in writing browsers, or even filesystems vs databases, so someone could come along and point out I'm wrong any minute, but this is the impression I got from different defects I glanced through in Bugzilla over recent years. Mozilla have been pushing a lot of their stuff into SQLite instead of using custom storage solutions.
 
Sheriff
Posts: 67699
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems like an assumption without any basis in fact. Is there any evidence to support performance concerns with the use of SQLLite by Firefox?
 
paul nisset
Ranch Hand
Posts: 547
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know how Firefox uses SqlLite . If it automatically opens up a database every time it starts, then writing to a database that is already in memory would be quicker than disk I/O.
 
Rob Crowther
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now that I'm no longer replying on my phone, here's a ls *.sqlite of my Firefox profile:



Cookies are there on line 5, local storage data is in webappsstore.sqlite.
 
Albareto McKenzie
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rob for the replies and the others for adding info-discussion.

Cheers.
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic