Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service worker responds with cache to fetch requests everytime its available #1237

Closed
Rishabh570 opened this issue Aug 29, 2019 · 5 comments · Fixed by #1819
Closed

service worker responds with cache to fetch requests everytime its available #1237

Rishabh570 opened this issue Aug 29, 2019 · 5 comments · Fixed by #1819

Comments

@Rishabh570
Copy link

Please describe the problem (or idea)

What did you expect to see that you didn't?

This line in sw.js is responsible for responding with cache to every fetch request whenever the cache is available. Does this mean user would be getting a cached response every time? Do we have any cache invalidation techniques to make sure cache doesn't get stale?

Please show us where to look

https://beta.sequencer.publiclab.org

What's your PublicLab.org username?

icode365

This can help us diagnose the issue:

Browser, version, and operating system

Many bugs are related to these -- please help us track it down and reproduce what you're seeing!


Thank you!

Your help makes Public Lab better! We deeply appreciate your helping refine and improve this site.

To learn how to write really great issues, which increases the chances they'll be resolved, see:

https://publiclab.org/wiki/developers#Contributing+for+non-coders

@jywarren
Copy link
Member

We'd prefer that the latest version is made available if it can be fetched, and that the cache remain a fallback. What should we change it to in order to achieve that? Thank you!

cc #605 #953 #761

@Rishabh570
Copy link
Author

Okay so for that, I guess we should be using Network with Cache fallback Policy then...this would ensure that response is coming from the network when it's possible, it will fall back on the app cache if needed.

Something similar is implemented here in community toolbox, we can switch to something similar if it is not breaking anything here...?

@vivek-30
Copy link

@harshkhandeparkar i have solved this issue can i raise a PR for this?

@harshkhandeparkar
Copy link
Member

Sure!

@vivek-30
Copy link

Thank you ☺️

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

Successfully merging a pull request may close this issue.

4 participants