Skip to content

Instantly share code, notes, and snippets.

@masalib
Created August 12, 2018 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masalib/7647f3dfa7090d945262509a38cc3209 to your computer and use it in GitHub Desktop.
Save masalib/7647f3dfa7090d945262509a38cc3209 to your computer and use it in GitHub Desktop.
PWA:Workboxとは
importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.4.1/workbox-sw.js');
if (workbox) {
workbox.routing.registerRoute(
/.*\.css/,
workbox.strategies.staleWhileRevalidate({
cacheName: 'css-cache',
})
);
} else {
console.log(`Boo! Workbox didn't load 😬`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment