web.dev LIVE has kicked off! Join us now for our digital event from June 30th to July 2nd at web.dev/live

Class: BroadcastUpdatePlugin

Constructor

BroadcastUpdatePlugin

new BroadcastUpdatePlugin(options)

Construct a BroadcastCacheUpdate instance with the passed options and calls its notifyIfUpdated() method whenever the plugin's cacheDidUpdate callback is invoked.

Parameter

options

Object

Values in options have the following properties:

Parameter

headersToCheck

Optional

Array of string

A list of headers that will be used to determine whether the responses differ.

generatePayload

Optional

string

A function whose return value will be used as the payload field in any cache update messages sent to the window clients.