Latest Posts:

Learn the difference in cashing between HTML and HTML 5

Learn the difference in cashing between HTML and HTML 5

HTML introduces application cache, which means that a web application is cached, and accessible without an internet connection

Browsers use caching to store HTML web pages by storing a copy of visited pages and then using that copy to render when you re-visit that page. If the date on the page is the same date as the previously stored copy, then the computer uses the one on your hard drive rather than re-downloading it from the internet.

Application cache gives an application three advantages
Offline browsing - users can use the application when they're offline
Speed - cached resources load faster
Reduced server load - the browser will only download updated/changed resources from the server
Sections in a cache manifest file: CACHE, NETWORK, and FALLBACK
A manifest can have three distinct sections: CACHE, NETWORK, and FALLBACK.
CACHE:
This is the default section for entries in a cache manifest file. Files listed under the CACHE: section header (or immediately after the CACHE MANIFEST line) are explicitly cached after they're downloaded for the first time.
NETWORK:
Files listed under the NETWORK: section header in the cache manifest file are white-listed resources that require a connection to the server. All requests to such resources bypass the cache, even if the user is offline. The wildcard character * can be used once. Most sites need.
FALLBACK:
The FALLBACK: section specifies fallback pages the browser should use if a resource is inaccessible. Each entry in this section lists two URIs—the first is the resource, the second is the fallback. Both URIs must be relative and from the same origin as the manifest file. Wildcards may be used.
The CACHE, NETWORK, and FALLBACK sections can be listed in any order in a cache manifest file, and each section can appear more than once in a single manifest.

HTML5 Cache
HTML5 provides application cache, which means that a web application is cached, and accessible without an internet connection. Application cache gives an application three advantages:
The new HTML5 specification allows browsers to prefetch some or all of a website assets such as HTML files, images, CSS, JavaScript, and so on, while the client is connected. It is not necessary for the user to have accessed this content previously, for fetching this content. In other words, application cache can prefetch pages that have not been visited at all and are thereby unavailable in the regular browser cache. Prefetching files can speed up the site's performance, though you are of course using bandwidth to download those files initially. In addition to this application cache will provide
Speed since the entire contents of the specified page will be cached to browser so it will provide a better speed than browser cache
Reduce Server Load There is no need of a post back all the time, since all the contents are there in cache, till there is any changes in the Manifest file
Cache manifest: The cache manifest file is the heart of HTML5 application cache. We can specify what are the pages need not be cached, what should not, and even we can reuse this one as a error handling technique, for that we can specify a custom error page in the 
FALLBACK section to show if the user request a content that requires network connectivity.
Share on Google Plus
    Blogger Comment
    Facebook Comment