Skip to content

PrecacheFallbackPlugin ​

Class @vite-pwa/workbox-swkit/precaching

PrecacheFallbackPlugin allows you to specify an "offline fallback" response to be used when a given strategy is unable to generate a response.

It does this by intercepting the handlerDidError plugin callback and returning a precached response, taking the expected revision parameter into account automatically.

Unless you explicitly pass in a PrecacheController instance to the constructor, the default instance will be used. Generally speaking, most developers will end up using the default.

Constructor ​

ts
new PrecacheFallbackPlugin(config: { fallbackURL: string; precacheController?: PrecacheController })

Constructs a new PrecacheFallbackPlugin with the associated fallbackURL.

Released under the MIT License.