You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: text/html, text/javascript, image/svg+xml must not be included here
Callback to Validate Cacheable URL
hook.parameters.validateCacheableUrl = function (url, contentType)
url: String: target URL to validate
contentType: String: normalized Content-Type without charset
return a truthy value if url with contentType is cacheable
If the callback function is undefined, any contentType values within hook.parameters.cacheableContentTypes are cacheable
Extended Metadata Format in cache-bundle.json
cacheBundle={"version": "version_123",// cache version"url?param=1": "body in string",// concise format for string data for .js, .html, .json, .svg; equivalent to { "body": "body in string", "Content-Type": "{type}" }"url?param=2": {"Location": "url?param=1",// link to the other content"Location": "data:image/jpeg;base64,...",// encoded body data; Note: "Location" appears only once in a metadata object, of course// If Non-dataURI "Location" exists, other metadata entries are ignored"Content-Type": "text/xml",// MIME type"body": "body in string",// content body"Other-Headers": "header value",// HTTP headers},}
The text was updated successfully, but these errors were encountered:
[cache-bundle] Additional Content-Types to
cache-bundle.json
API
text/html
,text/javascript
,image/svg+xml
hook.parameters.significantHeaders = { "Header-Name": true }
hook.parameters.cacheableContentTypes = { "text/css": true, "image/png": true, ... }
text/html
,text/javascript
,image/svg+xml
must not be included herehook.parameters.validateCacheableUrl = function (url, contentType)
url: String
: target URL to validatecontentType: String
: normalized Content-Type without charseturl
withcontentType
is cacheablecontentType
values withinhook.parameters.cacheableContentTypes
are cacheablecache-bundle.json
The text was updated successfully, but these errors were encountered: