Hi, i have an issue where when i refresh my app after some css changes, it doesn’t update the CSS. What i have to do all the time to actually update the app is go into the Developer tools > Network and click the Disable cache button to then refresh and the updates show. How do i fix this issue?
I feel you @ramoth123! This can be super annoying. What browser are you using?
To preview your CSS changes in Chrome, you can do a hard refresh without opening the dev tools, which makes it less of a pain. There are similar tricks for other browsers as well.
To do a Chrome/Windows hard refresh:
- Hold down Ctrl and click the browser refresh button.
To do a Chrome/Mac hard refresh:
- Hold down ⌘ Cmd and ⇧ Shift key and then press R.
i tried that and it still doesn’t update the CSS. I have to go to the dev tools and do it manually in there! It’s starting to get really annoying!
How are you serving the css files?
If you’re using express static, you can set the maxAge option to have them expire quicker.
Another workaround is to refer to them with a changing url, example “mystyles.css?v=21”