Skip to content

Latest commit

 

History

History

1.0.cache-static-files

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

1.0 Service Worker - Cache Static Files

In this step we will create a caching system stored in service worker.

review on Google Chrome Dev Tools

Run

Make sure you have installed http-server globally and then run it in this directory:

http-server -p 18081

Open your browser and access http://localhost:18081 (Note: http-server can be configured to start on a different port)

Before and After

Before using Service Worker Before using service worker Assets are not loaded from the cache.

After using Service Worker Aafter using service worker Assets are loaded from cache/service worker and loaded faster.

Learn More

Service Worker Live Cycle

Install -> Fetch -> Update -> Install -> ...

Official Documentation

Code Reference : https://developers.google.com/web/fundamentals/getting-started/primers/service-workers

Supported Web Browser

Please follow this link, to get the most up-to-date information about what browsers already support.