Closed desaintflorent closed 1 year ago
Hi @desaintflorent , what would you need as configuration to achieve your goal ? Would you have a piece of code of the resulting worker file you want to have it working ?
That is what I'm using right now with the official nuxt pwa module :
workbox: {
suffix: "v1",
runtimeCaching: [
{
urlPattern: "http://domain.com/api/.*",
handler: "networkFirst",
method: "GET",
strategyOptions: {
cacheName: "api",
cacheableResponse: { statuses: [0, 200] },
},
},
{
urlPattern: "http://files.domain.com/.*",
handler: "staleWhileRevalidate",
strategyOptions: {
cacheName: "images",
cacheExpiration: {
maxEntries: 30,
maxAgeSeconds: 300, //60 * 60// 1h
},
cacheableResponse: { statuses: [0, 200] },
},
},
],
},
Great, I'll work on this. Do you need the suffix
option too ? I'm not sure what it does but I can anyway check official Nuxt 2 PWA module code.
@desaintflorent I'm gonna add support for custom workbox template in which you'll be able to fully customize your runtime caching.
We may add module options later on but I want first to provide a way to fully customize the worker with own template first.
Ok great ! keep me updated 🙌
Hi there, I'm using the runtimeCaching option with workbox because my images are from a different domain. I can see that workbox extra options are not supported for this module, could I use this module and still cache images from different domain ?