Properties

cacheNames

constant   static

Get the current cache names and prefix/suffix used by Workbox.

cacheNames.precache is used for precached assets, cacheNames.googleAnalytics is used by workbox-google-analytics to store analytics.js, and cacheNames.runtime is used for everything else.

cacheNames.prefix can be used to retrieve just the current prefix value. cacheNames.suffix can be used to retrieve just the current suffix value.

Returns

Object An object with precache, runtime, prefix, and googleAnalytics properties.

clientsClaim

constant   static

Claim any currently available clients once the service worker becomes active. This is normally used in conjunction with skipWaiting().

setCacheNameDetails

constant   static

Modifies the default cache names used by the Workbox packages. Cache names are generated as <prefix>-<Cache Name>-<suffix>.

Parameter

details

Object

Values in details have the following properties:

Parameter

prefix

Optional

Object

The string to add to the beginning of the precache and runtime cache names.

suffix

Optional

Object

The string to add to the end of the precache and runtime cache names.

precache

Optional

Object

The cache name to use for precache caching.

runtime

Optional

Object

The cache name to use for runtime caching.

googleAnalytics

Optional

Object

The cache name to use for workbox-google-analytics caching.

skipWaiting

constant   static

Force a service worker to become active, instead of waiting. This is normally used in conjunction with clientsClaim().

Method

registerQuotaErrorCallback

static

registerQuotaErrorCallback(callback)

Adds a function to the set of callbacks that will be executed when there's a quota error.

Parameter

callback

function()