microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.13k stars 29.27k forks source link

Devtools don't reload CSS files #148541

Open jrieken opened 2 years ago

jrieken commented 2 years ago

https://user-images.githubusercontent.com/1794099/166214372-e37c5ae1-f673-4f72-ac14-8cc1593efa83.mov

deepak1556 commented 2 years ago

Reloading uses the same process causing the css files to be cached. Disabling cache in network tab or reloading via devtools (Cmd + R) which uses a different code path will bypass this cache. I wonder if adding a Last-Modified header from Electron's custom protocol handler could be a viable solution when running OSS.

deepak1556 commented 10 months ago

Aggressive caching for subresources is intended in the runtime https://bugs.chromium.org/p/chromium/issues/detail?id=654378#c4 and the only way to force revalidation is via Cache-Control: max-age=0 or Last-Modified headers. Do we want to add this workaround for OSS css resources ?

jrieken commented 10 months ago

I'd say so but we can also discuss in the team. Today's workaround is to disable caching which has the same effect but is a trick that you need to know