Contact emails
Spec
https://fetch.spec.whatwg.org/#dom-request-cache
Summary
Request.prototype.cache and RequestInit.cache enables developers to observe / control cache mode for a Request.
By setting RequestInit.cache, a developer can make a fetch which fails if the request is not stored in the cache, for example.
fetch('/', {mode: 'same-origin', cache: 'only-if-cached'});
By observing Request.cache on a service worker, a developer can distinguish whether a request is a reload request or not, for example.
self.addEventListener('fetch', e => {
if (e.request.cache === 'no-cache') {
// We can serve a stale request stored in the Cache storage
...
}
});
Link to “Intent to Implement” blink-dev discussion
None (Sorry - it looks we forgot to send an intent to implement when we started the effort)
Link to Origin Trial feedback summary
None
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Demo link
None
Debuggability
None
Risks
Interoperability and Compatibility
The risks are low as the spec is stable and Firefox already shipped the feature.
Edge: No signals
Firefox: Shipped
Safari: No signals
Web developers: No Signals
Ergonomics
Are there any other platform APIs this feature will frequently be used in tandem with? Service Worker
Could the default usage of this API make it hard for Chrome to maintain good performance (i.e. synchronous return, must run on a certain thread, guaranteed return timing)?
No
Activation
Will it be challenging for developers to take advantage of this feature immediately, as-is?
No
Would this feature benefit from having polyfills, significant documentation and outreach, and/or libraries built on top of it to make it easier to use?
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
Tests are available as web platform tests: fetch/api/request/request-cache* and fetch/api/request/request-error.html
Entry on the feature dashboard
Interoperability and Compatibility
The risks are low as the spec is stable and Firefox already shipped the feature.
Edge: No signals
Firefox: Shipped
Safari: No signals
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABihn6EzZbU7UVskme%3DezaSpShxJ%2BpMv5mh%3D-tbFP8kS-NepoQ%40mail.gmail.com.
Contact emails
Spec
https://fetch.spec.whatwg.org/#dom-request-cache
Summary
Request.prototype.cache and RequestInit.cache enables developers to observe / control cache mode for a Request.
By setting RequestInit.cache, a developer can make a fetch which fails if the request is not stored in the cache, for example.
fetch('/', {mode: 'same-origin', cache: 'only-if-cached'});
By observing Request.cache on a service worker, a developer can distinguish whether a request is a reload request or not, for example.
self.addEventListener('fetch', e => {
if (e.request.cache === 'no-cache') {
// We can serve a stale request stored in the Cache storage
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABihn6Gf662CarK-6rDnQRuDBdTJA5HdrFsSvNNJEFff6Sf%3DWQ%40mail.gmail.com.
self.addEventListener('fetch', e => {
if (e.request.cache === 'no-cache') {
// We can serve a stale request stored in the Cache storage
LGTM2
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABihn6FdTUYcPGaukbpg8Wop6nBpX_iaG6Eihv4z2HqF2y5T%3DQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.