March 28th, 2020

Replying to a tweet from @betterThanMin

Sure. Fire away.

51° N , 0° E

Also on Twitter

Reply Retweet Favourite

Responses

Stephan Max

Great! On p92 you are saying “The logic […] is a particularly powerful pattern. Because you’re looking in the cache first before trying the network, a returning visitor [will get content almost instantly].” Is that true? Bc you do a waitUntil on the event for the network…

# Posted by Stephan Max on Saturday, March 28th, 2020 at 8:53am

Stephan Max

So, aren’t new waiting for the network request after all? If the user has a bad connection that might take a while. Or am I missing something? Thanks in advance!

# Posted by Stephan Max on Saturday, March 28th, 2020 at 8:56am

Jeremy Keith

The return part still happens first though. The waitUntil ensures that the service worker doesn’t “hang up” while you’re getting the fresh version from the network, but while that’s happening, the user has been served the cached file. adactio.com/notes/16636

Jeremy Keith

They’re both asynchronous actions—using cache and using fetch—and the waitUntil ensures that when one of them is done, the other still carries on. It doesn’t mean that one waits until the other is done. adactio.com/notes/16637

Have you published a response to this? :