Provide offline access with Service Worker

Application cache is deprecated. It is quite headache to maintain. Now we use Service Worker to cache offline file.

This feature is in the process of being removed from the Web platform. (This is a long process that takes many years.) Using any of the offline Web application features at this time is highly discouraged. Use service workers instead. β€” WHATWG spec

Service worker as proxy

Service Worker is a proxy between browser and server. It can do much more than caching files. For example, it can run in background process and push notifications to your device.

The Google Chrome’s github page provides an example code on the offline capatability.

Note: But iOS has not supported Service Worker yet, so we still need to rely on the Application Cache to provide offline access in iOS.

Next Page β†’ Chapter 10 – Create dedicated mobile website

← Previous Page Offline access with app cache

Last updated at 2017-05-10. Show version history


no comments yet.