web.dev LIVE is now over! Head to web.dev/live to watch all the sessions, see top Q&A, and more.

Class: CacheOnly

Constructor

CacheOnly

new CacheOnly(options)

Parameter

options

Object

Values in options have the following properties:

Parameter

cacheName

string

Cache name to store and retrieve requests. Defaults to cache names provided by workbox-core.

plugins

Array of Object

Plugins to use in conjunction with this caching strategy.

matchOptions

Object

CacheQueryOptions

Method

handle

async

handle(options) returns Promise containing Response

This method will perform a request strategy and follows an API that will work with the Workbox Router.

Parameter

options

Object

Values in options have the following properties:

Parameter

request

(Request or string)

A request to run this strategy for.

event

Optional

Event

The event that triggered the request.

Returns

Promise containing Response