Skip to content

Instantly share code, notes, and snippets.

@ptcane
ptcane / service-worker.js
Last active April 15, 2021 11:31
PWA service worker for caching resources and specifying offline URL (MockStocks project)
// Modifying CACHE_VERSION will result in previous caches being deleted
// Add any routes and resources required for your offline page to CACHE_URLS
// Specify the page you want shown when offline (must be in CACHE_URLS) with OFFLINE_URL
const CACHE_VERSION = 'v1'
const CACHE_URLS = [
'/',
'/offline',
'pure.css',
'side-menu.css',