Skip to content

Add support for compression dictionary transport#1854

Open
pmeenan wants to merge 13 commits into
whatwg:mainfrom
pmeenan:dictionaries
Open

Add support for compression dictionary transport#1854
pmeenan wants to merge 13 commits into
whatwg:mainfrom
pmeenan:dictionaries

Conversation

@pmeenan
Copy link
Copy Markdown
Contributor

@pmeenan pmeenan commented Aug 25, 2025

Add processing steps for handling HTTP Compression Dictionary Transport content encoding and dictionary negotiation (RFC pending publication).

This adds a processing layer between the HTTP cache and network fetch that handles most of the dictionary-based content encoding (including matching dictionaries to outgoing requests).

Additionally, it adds processing above the HTTP cache for storing the dictionaries for future use and defines the "compression-dictionary" initiator and destination (the matching HTML spec update is in-process).

Support for clearing the caches through clear-site-data is in this PR.

Fix #1739, #1839


Preview | Diff

@pmeenan
Copy link
Copy Markdown
Contributor Author

pmeenan commented Sep 3, 2025

The RFC is pending publication so this will have to wait until that happens (should be any day now). RFC number has been assigned and final edits are complete: https://www.rfc-editor.org/auth48/rfc9842

@pmeenan
Copy link
Copy Markdown
Contributor Author

pmeenan commented Nov 11, 2025

RFC has published now so this should be ready to go (just rebased it).

@pmeenan pmeenan requested a review from annevk November 11, 2025 16:47
@pmeenan
Copy link
Copy Markdown
Contributor Author

pmeenan commented Nov 13, 2025

From the TPAC 2025 discussions, I added support for opaque responses to use compression dictionary when the Cross-Origin-Resource-Policy response header is set to cross-origin.

Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs
Comment thread fetch.bs
@pmeenan
Copy link
Copy Markdown
Contributor Author

pmeenan commented Mar 19, 2026

Sorry for dragging this out. I think I addressed all of the questions/issues. The main question outstanding right now is if the no-cors path using CORP is "approved" or if there are more steps to getting that integrated before this can land.

I filed it as a question with the TAG but I'm happy do do a more formal review somewhere if necessary.

@pmeenan
Copy link
Copy Markdown
Contributor Author

pmeenan commented Apr 28, 2026

I switched back to only allowing dictionary use for non-opaque requests. It's cleaner from the browser's perspective and harder to get wrong for sites. This is what the browsers have implemented anyway and what the current WPT's test.

The spec change should be ready to go now and match Chrome's and Mozilla's implementations.

If we want to bring dictionary support to third-party embeds in some way (the main pain point for no-cors), we can solve that separately.

Comment thread fetch.bs Outdated

<li><p>Let <var>pattern</var> be the result of
<a for=/>creating a URL pattern</a> from <var>dictionaryValue</var>["<code>match</code>"]
and <var>request</var>'s <a for=request>current URL</a>.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the text for callers of this algorithm is written that way: "creating a URL pattern, given dictionaryValue["match"], request's current URL and an empty map".

Also, request's current URL is an URL not a string, so we should perform a serialization similar to https://urlpattern.spec.whatwg.org/#other-specs-http (IIUC we can't use that one, because dictionary["match"] is a dictionary value not an HTTP structured field value).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This should be fixed now. I changed it to extract the "item" from match and to serialize the URL. Let me know if you think a different serialization is needed than the one I used.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add compression dictionary negotiation and decoding to the fetch processing model

3 participants