template icon indicating copy to clipboard operation
template copied to clipboard

caching when running `yarn dev`: livereload continues to reload page but same content is "stuck"

Open insidewhy opened this issue 5 years ago • 7 comments

Using chromium on archlinux, I've been developing an app for a week now.

However this scenario keeps happening frequently: I'm developing and there's a bug in my code. I keep changing the code to try to fix the bug and the page keep reloading but nothing changes. I get confused and frustrated and then I realise that even though the page is reloading, it's not reloading any of my source code changes. Despite the "reload", it's just continuously reloading a version of the code it's stuck on.

The only way to get it to see my changes is to close the browser window and reopen it.

It's gotten to the point where I've gotten paranoid about my svelte app. Whenever there's a bug I keep closing the window and opening a new one because I can't trust what I'm seeing. It leads me to feeling really negatively about the development experience.

insidewhy avatar May 12 '20 10:05 insidewhy

I wonder if sirv is missing some headers to stop chromium from caching the page?

insidewhy avatar May 12 '20 10:05 insidewhy

Sometimes shutting and reopening the window doesn't work either. I've reloaded my browser several times and the page just won't update :( I had to hold down shift and hit reload this time, there's definitely some caching issues going on here.

insidewhy avatar May 12 '20 12:05 insidewhy

I have the same Issue. It worked fine the most of the time. The first time it helped to restart the computer. But not anymore.

AmmonStretz avatar May 21 '20 04:05 AmmonStretz

@AmmonStretz It's so annoying right? Not being able to trust what you're seeing. Every single time there's a bug now I don't know if I've already fixed it or not.It's so frustrating I'm regretting not going with Vue 3 beta instead of Svelte haha.

insidewhy avatar May 21 '20 05:05 insidewhy

Is there a small repro app and a few steps I can do to replicate the issue?

antony avatar May 21 '20 06:05 antony

@antony There's no real way to reproduce it in a few steps, just develop for a few hours in any project and eventually it'll get stuck. I think sirv --dev just isn't using the right headers to stop browsers caching.

insidewhy avatar May 21 '20 09:05 insidewhy

I've been developing with Sapper for years and I've never seen this. I wonder what the difference in headers is.

antony avatar May 21 '20 09:05 antony