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

mind your cache #99

Open
adsick opened this issue May 22, 2023 · 2 comments
Open

mind your cache #99

adsick opened this issue May 22, 2023 · 2 comments

Comments

@adsick
Copy link

adsick commented May 22, 2023

Hi, I'm trying to learn Leptos right now, but when I tried to run it's examples on a local machine I've seen just the leftovers from some eframe stuff I was doing before. When I refreshed the page that stuff was still there despite active Trunk with a Leptos app. Only force update helped (Ctrl+Shift+R).

I'm not saying that there is anything wrong with this template, but I encountered some confusion so I decided to share it. Also I know that there is code in this repo that is responsible for making cache work, maybe it's not 100% correct? is it possible to only ship it in release builds?

Browser: Firefox 113.0.1

@coderedart
Copy link
Contributor

I often get confused by this too. This is why there is a warning in the README about caching behavior and how to get around this.

assets/sw.js script will try to cache our app, and loads the cached version when it cannot connect to server allowing your app to work offline (like PWA). appending #dev to index.html will skip this caching, allowing us to load the latest builds during development.

@fdb
Copy link

fdb commented Jun 29, 2023

Thanks for posting this. In my app it doesn't make sense to have a service worker so I just deleted that <script> in index.html.

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

No branches or pull requests

3 participants