workbox.broadcastUpdate. BroadcastCacheUpdate
Uses the Broadcast Channel API to notify interested parties when a cached response has been updated.
For efficiency's sake, the underlying response bodies are not compared; only specific response headers are checked.
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 |
||||||
options |
Object Values in
|
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. |