tmLanguage.json changes do not appear without resetting browser cache
Is there an existing issue for this?
- [X] I have searched the existing issues
OS/Web Information
- Web Browser: Any
- Local OS: Any
- Remote OS: Linux
- Remote Architecture:
code-server --version: 4.23.0
Steps to Reproduce
- Open vscode in browser, open network panel, uncheck "Disable cache"
- Make a change to tmLanguage.json (for example add 1 symbol in existing "$comment" field, like
"$comment": "Hello"->"$comment": "Hello1") - Re-deploy code-server
- Reload the browser page with vscode
- Observe in network panel that tmLanguage.json is not having the change
Expected
tmLanguage.json is not cached by browser when it has any changes
Actual
tmLanguage.json is cached by browser when it has any changes, so these changes do not appear until the page with vscode is reloaded without cache
Logs
No response
Screenshot/Video
No response
Does this bug reproduce in native VS Code?
I did not test native VS Code
Does this bug reproduce in GitHub Codespaces?
I did not test GitHub Codespaces
Are you accessing code-server over a secure context?
- [X] I am using a secure context.
Notes
I investigated a little bit and here are some thoughts:
- I see that the code-server uses weak eTag to cache resource, I verified that on changes to tmLanguage.json eTag is not getting changed.
- Seems like service worker (service-worker) intercepts requests, and, when catching 304 responds with cached resource which has 200 status. That's confusing to observe, that etag resource has 200 but not 304.
Interesting, I believe the eTag and service worker are provided by VS Code, which means this might be an upstream issue https://github.com/microsoft/vscode
But, maybe there is something odd in the way we wrap VS Code that causes the issue. We should try to reproduce in Codespaces to see if it is an upstream issue or a code-server issue.
https://github.com/microsoft/vscode/blob/4c4ac63f36df8d9ae67f894686d1ffbaf8cb5294/src/vs/workbench/services/timer/browser/timerService.ts#L666
Since for now it seems like there is not something we can change in code-server, I will go ahead and close the issue. If that changes we can reopen.