Constructor

BroadcastCacheUpdate

new BroadcastCacheUpdate(channelName, options)

Construct a BroadcastCacheUpdate instance with a specific channelName to broadcast messages on

Parameter

channelName

string

The name that will be used when creating the BroadcastChannel.

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.

source

Optional

string

An attribution value that indicates where the update originated.

Method

notifyIfUpdated

notifyIfUpdated(firstResponse, secondResponse, url, cacheName)

Compare two Responses and send a message via the Broadcast Channel API if they differ.

Neither of the Responses can be opaque.

Parameter

firstResponse

Response

First responses to compare.

secondResponse

Response

Second responses to compare.

url

string

The URL of the updated request.

cacheName

string

Name of the cache the responses belong to. This is included in the message posted on the broadcast channel.