Skip to content

Add CacheStorage controlled fetch broker - #303

Merged
wieslawsoltes merged 1 commit into
mainfrom
feature/cache-storage-fetch-broker-266
Sep 17, 2026
Merged

wieslawsoltes merged 1 commit into
mainfrom
feature/cache-storage-fetch-broker-266

Conversation

@wieslawsoltes

@wieslawsoltes wieslawsoltes commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Problem

A scope-controlled Code OSS webview can register and activate its Service Worker, but resource requests cannot reach its fetch listener and the worker has no CacheStorage. The unchanged worker blocks first on caches.open(...).match(event.request) before it can request a resource from its client.

Result

  • Adds bounded, worker-local CacheStorage/Cache brands with empty-match, request-keyed put/match/delete/keys, cloned responses, 256-entry/64 MiB limits, and illegal constructors/receiver checks.
  • Adds an asynchronous 32-request controlled-fetch broker from Window fetch() to the isolated worker FetchEvent, preserving status, headers, body, fallthrough to the host loader, rejection, client generation retirement, unregister, and shutdown behavior.
  • Splits the enlarged worker bootstrap into MSVC-safe raw literals and extends the portable-literal regression.
  • Adds a WPT-derived native/browser contract and a native 100-cycle lifecycle/performance/memory gate.

Part of #266. This lower stack entry intentionally leaves WritableStream/TransformStream fallback, parser/image/style interception, range/cache validators, and unchanged Markdown product acceptance to dependent work.

Validation

  • Native service-worker-resource-plane: 100 cycles, p95 0.192 ms; V8 heap 1,144,632 -> 1,144,632 bytes; peak RSS 38,207,488 -> 49,184,768 bytes. The same gate rejects 65 logical MiB before allocating the combined response.
  • Native candidate contract: 1/1 document, 3/3 subtests, 132 ms.
  • Bootstrap literal regression: 2/2 tests; clean snapshot/native build.
  • The dependent cumulative top adds TransformStream and carries the Chrome oracle.
  • Rebased head bd1b872e is conflict-free on main 3d143240; the only Implement effective CSS property cascade semantics #305 path overlap is the additive component-profile ledger. Cumulative-top revalidation passes the bootstrap/syntax/build gates, the native contract (3/3, 69 ms), and 100 cycles (p95 0.210 ms; heap 1,161,232 -> 1,161,232 bytes; peak RSS 38,207,488 -> 49,266,688 bytes).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant