mirror of
https://github.com/coder/code-server.git
synced 2026-11-05 08:23:15 +08:00
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:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user