ladybird/Libraries/LibWeb/Fetch/Fetching
Timothy Flynn 0482b6bb57 LibWeb+LibWebView+WebContent: Implement versioning for document cookies
This patch introduces a cookie cache in the WebContent process to reduce
blocking IPC calls when JS accesses document.cookie. The UI process now
maintains a cookie version counter per-domain in shared memory. When JS
reads document.cookie, we check whether we have a valid cached cookie by
comparing the current shared version to the last used version. If they
match, the cached cookie is returned without IPC.

This optimization is based on Chromium's shared versioning, in which it
was observed that 87% of document.cookie accesses were redundant. See:
https://blog.chromium.org/2024/06/introducing-shared-memory-versioning-to.html

Note that this cache only supports document.cookie, not HTTP Cookie
headers. HTTP cookies are attached to requests with varying URLs and
paths. The cookies that match the document URL might not match the
request URL, which we wouldn't know from WebContent. So attaching the
cached document cookie would be incorrect.

On https://twinings.co.uk, we see approximately 600 document.cookie
requests while the page loads. This patch reduces the time spent in
the document.cookie getter from ~45ms to 2-3ms.
2026-02-05 07:28:07 -05:00
..
Checks.cpp LibWeb: Store HTTP methods and headers as ByteString 2025-11-26 09:15:06 -05:00
Checks.h
FetchedDataReceiver.cpp LibWeb: Support MIME type sniffing for streaming HTTP responses 2026-01-24 15:21:26 +01:00
FetchedDataReceiver.h LibWeb: Support MIME type sniffing for streaming HTTP responses 2026-01-24 15:21:26 +01:00
Fetching.cpp LibWeb+LibWebView+WebContent: Implement versioning for document cookies 2026-02-05 07:28:07 -05:00
Fetching.h LibHTTP+LibWeb: Store the in-memory HTTP cache without JS realms 2025-12-21 08:59:31 -06:00
PendingResponse.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
PendingResponse.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
RefCountedFlag.cpp
RefCountedFlag.h