workbox
workbox copied to clipboard
Ship CacheNetworkRace as part of workbox-strategies
Library Affected: workbox-strategies
We currently have code for a "cache and network race" strategy in our docs. The entirety of it looks like:
import {Strategy} from 'workbox-strategies';
class CacheNetworkRace extends Strategy {
_handle(request, handler) {
const fetchAndCachePutDone = handler.fetchAndCachePut(request);
const cacheMatchDone = handler.cacheMatch(request);
return new Promise((resolve, reject) => {
fetchAndCachePutDone.then(resolve);
cacheMatchDone.then((response) => response && resolve(response));
// Reject if both network and cache error or find no response.
Promise.allSettled([fetchAndCachePutDone, cacheMatchDone]).then((results) => {
const [fetchAndCachePutResult, cacheMatchResult] = results;
if (fetchAndCachePutResult.status === 'rejected' && !cacheMatchResult.value) {
reject(fetchAndCachePutResult.reason);
}
});
});
}
}
Some folks have asked if we could ship it as part of workbox-strategies
to make it more "official."
Off-topic for this PR, but when would it be the case that the disk is slower than network? On slow and old HDDs?
There's some analysis at https://simonhearne.com/2020/network-faster-than-cache/
Hey, I am interested in this issue. Could you guide me a bit? From where should I start?
Hello, I'm new to open source and I would like to give this a try! If I understood the issue description correctly, the above-mentioned 'cache and network race' code snippet needs to be integrated with workbox-strategies. Please correct me if I am wrong and I would like to start working on this asap.
Hi there is anyone working on this issue? If not may i please try this one out? @parthpatel9414 or @Midas847 may you please advise me if this has been worked on?
Hey team, can someone please confirm if anyone is working on this issue, If not I would love to know more about it and resolve it :)
Guys happy to assist if anyone is working on this issue
@Aditya-Naresh Can you please assign this to me?
@ZainGulbaz I think you have to ask @jeffposnick
Jeff left Google 8 months ago. The new maintainer finally confirmed the other day that workbox has been deprecated.
#3149
Workbox is not deprecated. It is understaffed, we are not releasing a new version this year, but it is in our roadmap and we want to find a path via the community or another organization to staff it better.
Hi @tropicadri, I am new here but really wanna contribute to Workbox. Can you guide me a little to work on this?
Hey, can I work on this issue
Hello @tropicadri, please let me know how I could contribute! I'm really interested and would appreciate guidance.
Is it still open ? I want to do this task