Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

networkOnly and networkFirst not working #167

Closed
JeremyBernier opened this issue Aug 4, 2016 · 2 comments
Closed

networkOnly and networkFirst not working #167

JeremyBernier opened this issue Aug 4, 2016 · 2 comments

Comments

@JeremyBernier
Copy link

JeremyBernier commented Aug 4, 2016

It's always loading the cached files even though the console logs tell me it's doing network only/first.

I'm using the code straight from the example (https://github.com/GoogleChrome/sw-toolbox/blob/master/recipes/cache-expiration-options/service-worker.js)

global.toolbox.router.get('/style.css', global.toolbox.networkFirst)
global.toolbox.router.default = global.toolbox.networkOnly

Is anybody else also getting this problem? How do I even go about debugging this? Breakpoints seem to act kind of weird on the service-worker.js file.

(I'm on Chrome 52.0.2743.116 (64-bit)., OS X)

@wibblymat
Copy link
Contributor

Something to be aware of is that when we go to "the network", we really mean the normal browser process. This includes the regular browser cache.

Try turning off the cache in devtools (Network panel > Disable cache) and try again. If this fixes your problem then your issue is actually with the cache headers being sent by your server.

If not then let us know, and we'll have a deeper look.

Re: breakpoints. It seems our source maps are a bit wacky, sorry about that - see #169.

@JeremyBernier
Copy link
Author

Ok it works. I'm an idiot (could've sworn I tried that). Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants