Have a voice in guiding the future of Google's developer brands. Share your thoughts in our survey.

Class: CacheFirst

Constructor

CacheFirst

new CacheFirst(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.

fetchOptions

Object

Values passed along to the init of all fetch() requests made by this 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