HTML5 – building offline applications

HTML5 – building offline applications

In this article we will explore HTML5 offline applications.

What are HTML5 offline applications?

For a typical web application we need connectivity. Webpage is server to the user, user does something and interact with the site or page and further requests or round trips to and from the server to operate correctly.

So whenever the internet connectivity is lost web site  does not work correctly. So idea behind the offline application is that unlike typical web application an offline web application will continue to work even if there is no internet connectivity.

It works like the pages or the parts of pages that are required to work offline are copied down to the user’s computer and save in place where those file can reliably be retrieved.

One thing to notice is that if user visits a page of our website say the page will be served from application cache.

Programmatically offline applications are combination of two pieces of technology those are

  1. Browser Events
  2. Application cache

So we will build an application that will respond to the online and offline browser events. So there are events that are fired when the browser recognizes that it is online of offline  from web. There is a Boolean property that we can use to check that whether it is online or offline, on top of that this is where HTML5 new features are available is the application cache , So the application cache come with  its own series  of events and series of its own construction in order to make that place in user ‘s computer where pages can served reliably over and over again.

So idea is that this is in contrast to regular browser caching where if you disconnect from internet and you try to refresh the page and you get image do not show up and css wont show up and you have different broken area but application cache gives you the opportunity to reliably serve those files when you are not connected to the web.

So thats it for the this article in coming articles we will explore offline applications in more detail