Repository navigation
Conversation
The browser writes some workspace files to the client disk during normal use. The webview service worker stores resources that have an ETag in Cache Storage, and responses from /vscode-remote-resource can end up in the HTTP disk cache. --disable-file-downloads does not cover either. With --disable-file-cache, the webview resource loader sends no ETag for a resource outside the webview's own extension, so the service worker does not store it. /vscode-remote-resource responds with `Cache-Control: no-store` for files outside the extension directories. Extension files keep their ETags, so webviews still load extension code from the cache. The flag is off by default. The VS Code changes are in a new patch that follows the plumbing of external-file-actions.diff. The e2e tests check the Cache Storage of the Markdown preview webview and the headers of /vscode-remote-resource.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8084
Add a
--disable-file-cacheflag, off by default. With the flag, the browser does not store workspace files on the client disk.Make the webview resource loader send no ETag for a resource outside the webview's own extension. The webview service worker stores only responses that have an ETag, so these resources stay out of Cache Storage.
Serve
/vscode-remote-resourcewithCache-Control: no-storefor files outside the extension directories. Extension files keep their ETag and theirmax-ageheader.Put the VS Code changes in a new patch,
patches/disable-file-cache.diff, which passes the flag the same way asexternal-file-actions.diff. The patch is last inpatches/series, becausegetting-started.diffdoes not apply when the new patch comes right afterexternal-file-actions.diff.Add
test/e2e/fileCache.test.ts:/vscode-remote-resourceresponds withno-storefor a workspace file and with an ETag for an extension file;The two tests with the flag fail when the VS Code patch is removed.
Add
--disable-file-cacheto the parser test intest/unit/node/cli.test.ts.Add a changelog entry under "Unreleased".
Entries that the browser cached before the flag was set stay in the cache. The flag stops only new entries.