HTML and CSS Reference
In-Depth Information
Figure 8-1. Working offline in Firefox
• Traditional HTTP caching can be ine-tuned using cache-control headers. HTML5
offline applications rely on a manifest file and always work in an offline fashion even
if network connectivity is available.
• Traditional HTTP caching is an implicit mechanism, and no thought is given to how
web pages should behave while the browser is in offline mode. HTML5 offline
applications are explicitly developed with requirements such as data storage and
network availability in mind.
Building an Offline Application
Offline applications essentially fetch server resources such as web pages, images, style sheets, and script
files and store them in the browser's local cache. Once the files are on the local machine, there is no need
for network connectivity. Of course, later you may need to go online to synchronize local and server-side
data.
To develop an offline application, you need to follow these basic steps:
1.
Create a cache manifest file.
2.
Add references to the cache manifest file to all the web pages that are part of the
offline application.
3.
Configure the web server so that it recognizes the cache manifest file extension.
4.
In JavaScript code, periodically check whether network connectivity with the
server is available.
A cache manifest is a text file that lists all the file-based resources of an offline application. The
resources listed in a cache manifest file include files that are to be cached, files that are to be fetched over a
network rather than cached locally, and substitute files in case files can't be cached for some reason. An
ASP.NET web application may contain many web pages out of which only a few are used as an offline
 
Search WWH ::




Custom Search