Scripts

Local storage and offline applications in HTML 5

Web developers have traditionally used cookies to store information on a visitor’s
local machine, allowing a Web page to read this information back at a later point.
While cookies are very useful for storing basic data, they are limited by the fact that
Web browsers are not required to keep more than 20 cookies per Web server or
more than 4KB of data per cookie (including both name and value). In addition, they
are sent to the Web server with every HTTP request, which is a waste of resources.
HTML5 provides a solution for these problems with the Local Storage APIs, which
are covered in a separate specification to the main HTML5 document. This set of
APIs allows developers to store information on the visitor’s computer while remaining
reasonably confident that they will still be there at a later date. In addition, the
information is accessible at any point (even after the page has rendered) and is not
loaded automatically with each HTTP request. The specification includes
same-origin restrictions, which prevent Web sites from reading or changing data
stored by other Web sites.

Most browsers store Web pages in local cache, allowing them to be viewed even if
the user is offline. This works fine for static pages, but it is not available for dynamic
content that is typically database-driven, such as Gmail, Facebook, or Twitter.
HTML5 provides support for offline applications, where the browser downloads all
the files necessary to use the application offline, and when the user uses the
application offline, the browser can allow any changes made in the process to be
uploaded to the server when they reconnect to the Internet.

You Might Also Like