Constructor

Handler

new Handler(input)

Constructor for a new Handler instance.

Parameter

input

Object

Values in input have the following properties:

Parameter

waitOnCache

Optional

boolean

For handlers that write to the cache, true means the method should wait for the cache.put() call to complete before returning. The default value of false means return without waiting. It this value is true and the response can't be cached, an error will be thrown.

requestWrapper

Optional

module:workbox-runtime-caching.RequestWrapper

An optional RequestWrapper that is used to configure the cache name and request plugins. If not provided, a new RequestWrapper using the default cache name will be used.

Method

handle

abstract

handle(input) returns Promise containing Response

An abstract method that each subclass must implement.

Parameter

input

Object

Values in input have the following properties:

Parameter

event

FetchEvent

The event that triggered the service worker's fetch handler.

params

Optional

Object

Additional parameters that might be passed in to the method. If used in conjunction with the Route class, then the return value from the match function in the Route constructor will be passed in as the params value.

Returns

Promise containing Response A promise resolving with a response.