'https://storage.googleapis.com/workbox-cdn/releases/3.5.0/workbox-sw.js'
console.log(`Yay! Workbox is loaded π`)
workbox.precaching.precacheAndRoute([])
workbox.routing.registerRoute(
/\.(?:ico|png|gif|jpg|js|css|html|svg)$/,
workbox.strategies.cacheFirst({
cacheName: 'static-cache',
new workbox.expiration.Plugin({
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days
workbox.routing.registerRoute(
workbox.strategies.cacheFirst({
cacheName: 'times-cache',
new workbox.expiration.Plugin({
maxAgeSeconds: 10 * 24 * 60 * 60,
workbox.routing.registerRoute(
workbox.strategies.cacheFirst({
cacheName: 'index-cache',
new workbox.expiration.Plugin({
maxAgeSeconds: 10 * 24 * 60 * 60,
// Cache the Google Fonts stylesheets with a stale-while-revalidate strategy.
workbox.routing.registerRoute(
/^https:\/\/fonts\.googleapis\.com/,
workbox.strategies.staleWhileRevalidate({
cacheName: 'google-fonts-stylesheets',
// Cache the underlying font files with a cache-first strategy for 1 year.
workbox.routing.registerRoute(
/^https:\/\/fonts\.gstatic\.com/,
workbox.strategies.cacheFirst({
cacheName: 'google-fonts-webfonts',
new workbox.cacheableResponse.Plugin({
new workbox.expiration.Plugin({
maxAgeSeconds: 60 * 60 * 24 * 365,
console.log(`Boo! Workbox didn't load π¬`)