Add --disable-file-cache flag (#8085)

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.
This commit is contained in:
Andy Piper
2026-11-02 14:14:26 -09:00
committed by GitHub
parent ee16a40e41
commit 79d2c29c49
6 changed files with 336 additions and 0 deletions
+5
View File
@@ -51,6 +51,7 @@ export interface UserProvidedCodeArgs {
"disable-update-check"?: boolean
"disable-file-downloads"?: boolean
"disable-file-uploads"?: boolean
"disable-file-cache"?: boolean
"disable-workspace-trust"?: boolean
"disable-getting-started-override"?: boolean
"disable-proxy"?: boolean
@@ -193,6 +194,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
type: "boolean",
description: "Disable file uploads.",
},
"disable-file-cache": {
type: "boolean",
description: "Keep workspace files out of the browser cache.",
},
"disable-workspace-trust": {
type: "boolean",
description: "Disable Workspace Trust feature. This switch only affects the current session.",