THE PAST, PRESENT & FUTURE OF LOCAL STORAGE FOR WEB APPLICATIONS

  1. Cookies are included with every HTTP request, thereby slowing down your web application by needlessly transmitting the same data over and over.

  2. Cookies are included with every HTTP request, thereby sending data unencrypted over the internet (unless your entire web application is served over SSL).

  3. Cookies are limited to about 4 KB of data — enough to slow down your application (see above), but not enough to be terribly useful.

  1. a lot of storage space.
  2. on the client.
  3. that persists beyond a page refresh.
  4. and isn’t transmitted to the server.

A BRIEF HISTORY OF LOCAL STORAGE HACKS BEFORE HTML5

INTRODUCING HTML5 STORAGE

Article Summary

USING HTML5 STORAGE

Like other JavaScript objects, you can treat the localStorage object as an associative array. Instead of using the getItem() and setItem() methods, you can simply use square brackets. For example, this snippet of code:

    var foo = localStorage.getItem("bar");
    // ...
    localStorage.setItem("bar", foo);
    …could be rewritten to use square bracket syntax instead:

    var foo = localStorage["bar"];
    // ...
    localStorage["bar"] = foo;

BEYOND NAMED KEY-VALUE PAIRS: COMPETING VISIONS

The Web SQL Database specification has been implemented by four browsers and platforms.

Article Summary

References:

Main page