HTML5 Storage -Suggestions for Challenges Client side storages, making applications powerful, faster and work offline.
Web Storage Questions striking our mind??● What is it?● What we were using before it?● Why should we use it now?● Are they sufficient enough for our application?
What is web storage?● Client-side storag● A standardized and native API that works the same way on any browser.● Originally included in the Web Applications 1.0 specification, it has now its own specification called W3C Web Storage.
What we were using before it?● Cookies for client storage.● Cookies sent in every HTTP request.● Data sent unencrypted.● Size is very small (approximately 4KB).● Limited number of cookies stored per domain.
Why should we use it now?● Data not included with every request, but used only when asked for.● Store large data(5MB approx.), without affecting performance.● Data stored in key/value pairs and a page can only access data stored by itself.
Types of Web Storage● Local Storage ○ Data stored is available to all scripts within domain and persist even after browser is closed.● Session Storage ○ Data stored is available only to the script that stored the data and data is lost on closing of browser.
Browser Support for Web Storage● IE 8.0 and 9.0● Firefox 3.0, 3.5, 3.6 and 40● Safari 4.0, 5.0 and 6.0● Chrome 5.0, 6.0, 7.0, 8.0 and 9.0● Opera 10.5, 10.6 and 11.0● iOS Safari 3.2, 4.1 and 4.2● Android browser 2.2
What are its alternatives?● Client side structured storage (database).● WebSQL Database (Sqlite).● Indexed DB.
Browser Compatibility for both Databases● WebSQL ○ Chrome 4+ ○ Safari 4+ ○ Opera 11+ ○ iOs 5+ ○ Android 3+● Indexed DB ○ Chrome 11+ ○ Firefox 4+ ○ I.E 10
Application Cache??● ApplicationCache- HTML5 interface for caching.● Offline browsing- users can navigate your full site when theyre offline.● Speed-cached resources are local, and therefore load faster.● Reduced server load- the browser will only download resources from the server that have changed.
Some details● Works on one manifest file.● Need to add mimetype to server.● Three major sections a. CACHE b. NETWORK c. FALLBACK
Discussion !!● It seems that after using these things in our application (as per required) we can make application work offline. ri8??● Your opinion ??
Experience sharing● Offline Application requirement.● Can be achieved.● Required : no user dependency at all.● Problem with the current technology !!
Experience sharing(Contd...)● Ultimately "old is gold." Java Applet was the solution for me.● Still problem with some cases.● Issue 1: registered as a bug in java official forum.● Issue 2: Cannot access the close of browser.