DEV Community

Discussion on: Instant Webpages and Terabytes of Data Savings Through the Magic of Service Workers ✨

Collapse
 
dansilcox profile image
Dan Silcox • Edited

Nice! Typo / copy paste fail in the second code snippet I think -

if (!caches.match('/shell_top') || !caches.match('/shell_top')) { //return if shell isn't cached.
    return
}
Enter fullscreen mode Exit fullscreen mode

Second one should be shell_bottom right?

Collapse
 
dansilcox profile image
Dan Silcox

And by the way definitely got the near instant refresh effect you mentioned!

Collapse
 
ziizium profile image
Habdul Hazeez

Same here. Even when i throttled the connection to Regular 2G.

Collapse
 
ben profile image
Ben Halpern

Ha! Nice catch. Luckily for us it's highly unlikely shell_bottom is likely not missing unless shell_top is also missing. But we should definitely fix.

I'm going to start by fixing it in the demo above before patching it in the real code.

Feel free to do the honors if you'd like to submit the fix in the app itself...

github.com/thepracticaldev/dev.to/...

Collapse
 
dansilcox profile image
Dan Silcox

github.com/thepracticaldev/dev.to/... - hope I did it right, not done a PR on open source before!