workbox.strategies. NetworkFirst
An implementation of a network first request strategy.
By default, this strategy will cache responses with a 200 status code as well as opaque responses. Opaque responses are are cross-origin requests where the response doesn't support CORS.
If the network request fails, and there is no cache match, this will throw a WorkboxError
exception.
Constructor
NetworkFirst
new NetworkFirst(options)
Parameter |
|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object Values in
|
Methods
handle
handle(options) returns Promise containing Response
This method will perform a request strategy and follows an API that will work with the Workbox Router.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
options |
Object Values in
|
- Returns
-
Promise containing Response
makeRequest
makeRequest(options) returns Promise containing Response
This method can be used to perform a make a standalone request outside the context of the Workbox Router.
See "Advanced Recipes" for more usage information.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
options |
Object Values in
|
- Returns
-
Promise containing Response