next-pwa
next-pwa copied to clipboard
How to use specific caching strategy with next-pwa ?
How can I use a specific caching strategy with next pwa ?
For example I use it like this :
const withPWA = require("next-pwa"); const runtimeCaching = require("next-pwa/cache");
module.exports = withPWA({ pwa: { dest: "public", runtimeCaching, disable: process.env.NODE_ENV === "development", }, });
How can I use the network first caching strategy with next-pwa ?
https://github.com/shadowwalker/next-pwa/blob/master/cache.js is a preset of runtime caching configuration, feel free to copy it, modify it as you like, then passing the configuration object into pwa section of your next.config.js with runtimeCaching key.