workbox-cacheable-response. CacheableResponse
This class allows you to set up rules determining what
status codes and/or headers need to be present in order for a
Response
to be considered cacheable.
Constructor
CacheableResponse
new CacheableResponse(config)
To construct a new CacheableResponse instance you must provide at least
one of the config
properties.
If both statuses
and headers
are specified, then both conditions must
be met for the Response
to be considered cacheable.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
config |
Object Values in
|
Method
isResponseCacheable
isResponseCacheable(response) returns boolean
Checks a response to see whether it's cacheable or not, based on this object's configuration.
Parameter |
|
---|---|
response |
Response The response whose cacheability is being checked. |
- Returns
-
boolean
true
if theResponse
is cacheable, andfalse
otherwise.