Created
September 23, 2022 15:33
-
-
Save thangman22/92cec7d6838597dfbd29ae4f73da2ab4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importScripts( | |
'https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js' | |
) | |
workbox.routing.registerRoute( | |
new workbox.routing.Route(({ request }) => { | |
return request.url.includes('/generate') | |
}, | |
new workbox.strategies.CacheFirst({ | |
// Use a custom cache name. | |
cacheName: 'postr-download', | |
plugins: [new workbox.expiration.ExpirationPlugin({ | |
maxAgeSeconds: 3600 | |
})] | |
}) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment