Thursday, October 25, 2012

OSI Conference – 2012 - HTML5 – Offline Web Application development in HTML-5 – Local Storage



Web Storage:
            It is used to store structured data in client side.
It will be stored as a Key/Value pair.
It is similar to cookies
It can store 5MB per data store (2.5 MB per origin in Google Chrome; 5 MB per origin in Mozilla Firefox, and Opera; 10 MB per storage area in Internet Explorer)
It can be stored as a Session Storage or Locale Storage

 Types of storage
       Session Storage – Particular tab will get a storage area, which cannot be shared across the tabs of any browser. This will be useful for banking like applications. This doesn’t have any space limits.

        Local Storage – It is local to a browser, and can be shared across the sessions.  This will be useful for gaming like applications.
 
HTML5 gives full support on CSS3 scripts. It has separate tags to handle Video and Audio so there is no need of relying on any plugins to play video or audio files.

Local Storage APIs
Local Storage is the object  where we can have the following methods.

1.       setItem(Key, Value) – Set value for a particular key
2.       getItem(Key)     -              Get the value for the particular key
3.       removeItem(Key)           -              remove  a particular item from the store
4.       Clear()  -              Clears all the local stores
5.       Key(index)          -              Get the key for the particular 0 based index
6.       Length()               -              Get the count of the records

You can check the local store objects in the Google Chrome Devtool in the following menu
Tools -> DevTools -> Resources -> Local

Limitations of the local storage
1.       It can store only Strings
2.       It is stored as a clear text – so passwords we cannot store directly
3.       Performance is low.

    NORUKS:
For each sub domains there will be separate storage space.
     For entire file system there will be a single storage space. Even the files can come from different Drives, but it will share single storage space.


References:
W3CSchools, W3C Standards,
Dive into HTML5 – Local Storage
Paper Killed Rock.

For each sub domains there will be separate storage space.
For entire file system there will be a single storage space. Even the files can come from different Drives, but it will share single storage space.


No comments:

Post a Comment