Showing posts from January, 2018

ASP.Net HTML5 Client Side Caching using Service Worker Simplified

Client Side Caching Concept:

1. In HTML Era : Cookie was used to save content locally

2. In HTML5 Era: manifest file used to contain data like

Offline files

Online Files

This scheme was deprecated in 2016

3. Latest HTML5 Caching: Service Worker.js

Your website must run on SSL to use the caching feature.

How it works:

1. You have to write this script in your html5 or aspx page at bottom of body tag to register the serviseworker.js

 <script type="text/javascript">
    // ServiceWorker is a progressive technology. Ignore unsupported browsers
       if undefined'serviceWorker' in navigator) {
            console.logundefined'CLIENT: service worker registration in progress.');
            navigator.serviceWorker.registerundefined'serviceworker.js').thenundefinedfunction undefined) {
                console.logundefined'CLIENT: service worker registration complete.');
            }, function undefined) {

Google+ Followers