Skip to content

RuntimeCaching ​

Interface workbox-build

Properties ​

PropertyTypeDefaultDescription
handlerStrategyName | RouteHandlerThis determines how the runtime route will generate a response. To use one of the built-in workbox-strategies, provide its name, like 'NetworkFirst'. Alternatively, this can be a workbox-core.RouteHandler callback function with custom response logic.
method?HTTPMethod"GET"The HTTP method to match against. The default value of 'GET' is normally sufficient, unless you explicitly need to match 'POST', 'PUT', or another type of request.
options?{ backgroundSync?: { name: string; options?: QueueOptions }; broadcastUpdate?: { options: BroadcastCacheUpdateOptions }; cacheableResponse?: CacheableResponseOptions; cacheName?: string | null; expiration?: ExpirationPluginOptions; fetchOptions?: RequestInit; matchOptions?: CacheQueryOptions; networkTimeoutSeconds?: number; plugins?: WorkboxPlugin[]; precacheFallback?: { fallbackURL: string }; rangeRequests?: boolean }
urlPatternstring | RegExp | RouteMatchCallbackThis match criteria determines whether the configured handler will generate a response for any requests that don't match one of the precached URLs. If multiple RuntimeCaching routes are defined, then the first one whose urlPattern matches will be the one that responds.

This value directly maps to the first parameter passed to workbox-routing.registerRoute. It's recommended to use a workbox-core.RouteMatchCallback function for greatest flexibility.

Released under the MIT License.