How to set precache prefix name whit workboxPluginMode: 'InjectManifest' #14978
-
Due to problems updating my pwa under ios, I need to change the cache name prefix. It is currently generated as "precache-v2", thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found this solution: in custom-service-worker.js import { clientsClaim,cacheNames, setCacheNameDetails } from 'workbox-core' setCacheNameDetails({ |
Beta Was this translation helpful? Give feedback.
Found this solution: in custom-service-worker.js
import { clientsClaim,cacheNames, setCacheNameDetails } from 'workbox-core'
import { precacheAndRoute, cleanupOutdatedCaches, createHandlerBoundToURL } from 'workbox-precaching'
import { registerRoute, NavigationRoute } from 'workbox-routing'
setCacheNameDetails({
prefix: 'myapp',
suffix: 'v8',
precache: 'precache',
runtime: 'run-time',
googleAnalytics: 'ga',
});