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

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.