Skip to content

Stream and cache admitted Code OSS webview resources #266

Description

@wieslawsoltes

Parent epic: #264. Top-level release epic: #227.

Proven gap

VS Code OSS service-worker.js is the mandatory broker for every webview.asWebviewUri(...) request. It handles FetchEvent, Request/Response/Headers, Client messaging, range requests, ETag/Last-Modified, 401/404/206/304 results, streamed response chunks, CacheStorage, and localhost port mapping. It caps active host-response bodies at 32 and times unresolved requests out after 30 seconds.

WebScene b81f594c has a bounded fetch subset, but the audited native bindings contain no CacheStorage, FetchEvent, ReadableStream, WritableStream, or TransformStream implementation. Current Markdown content references extension CSS/scripts through asWebviewUri; local images and every other webview consumer share this broker.

Scope and dependencies

Acceptance

  • Selected Streams and Service Worker/CacheStorage WPTs plus Chromium oracles cover readable/writable/transform behavior, piping/cancel/error/backpressure, response clone/tee/body-use, cache match/put/version replacement, FetchEvent respondWith/waitUntil, and client-message transfer.
  • Native top-level + iframe contracts cover 200/206/304/401/404, GET/HEAD/method rejection, MIME, ETag, Last-Modified, byte ranges, aborted/timed-out requests, malformed chunks, stale generations, localResourceRoots traversal rejection, localhost mapping, and offline/cache behavior.
  • The broker enforces at most 32 active response bodies, bounded queued bytes, cancellation propagation, single release of every host lease, and zero live streams/cache operations after navigation or shutdown.
  • A 64 KiB warm local resource reaches first byte at p95 <= 100 ms; 32 concurrent 1 MiB resources complete with <= 64 MiB aggregate queued payload and no starvation; 100 cache-fill/evict cycles retain <= 8 MiB after warm-up. Publish Chromium/native throughput and peak-memory results.
  • Exact Markdown extension CSS/scripts, a local PNG/SVG, an external HTTPS image, a missing asset, and an out-of-root path behave like Chromium. Current vscode-demo/README.md remains the exact primary fixture even though it has no inline image today.
  • Representative notebook, custom editor, extension detail, chat/MCP, Mermaid, Simple Browser, and release-notes assets use the same path without consumer-specific bypasses.

Proposed PR stack

  1. Web Streams primitives and bounded body ownership;
  2. CacheStorage/Cache and Request/Response integration;
  3. FetchEvent dispatch and VS Code client broker;
  4. range/cache/security/performance gates and unchanged product resources.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions