Latest on Web Compression

Search within this presentation

Where Compression Fits in Web Performance

After an introduction highlighting his work on Chromium and WebPageTest, Pat Meenan puts compression tuning in perspective. He recommends fixing slow server responses, back/forward cache misses, and image loading priorities first. Smaller transfers save bandwidth, while browsers still have to parse and execute the full JavaScript payload.

How Browsers and Servers Agree on a Dictionary

Meenan explains how a prior HTTP response supplies byte sequences that a compressor can reference in later responses. He walks through how the browser selects one matching dictionary and how the server can respond with dictionary-compressed Brotli or Zstandard. He also reviews the standards process and browser support as of the talk.

From JavaScript Deltas to Faster HTML

Meenan uses the YouTube player to show how one bundle version can compress a later build, with some deltas cutting transfer size by 98%. He then explains how Google Search uses a site dictionary to compress recurring HTML, including its inline SVG logo. Native apps can also ship a dictionary and advertise it on HTTP requests.

Deploying and Debugging Dictionary Compression

Meenan describes how to pass dictionary-compressed responses through a CDN and how a Cloudflare Worker can handle compression at the edge. He explains why Brotli and Zstandard command-line output needs additional framing and a dictionary hash for HTTP delivery. He points to Resource Timing, origin tests, and Chrome’s dictionary diagnostics for verification.

When Old Dictionaries Multiply Cache Variants

Meenan shows how long cache lifetimes leave returning visitors advertising dictionaries that an origin may have stopped using. Varying responses by dictionary can fill edge caches with copies of the same fallback response, reduce cache hit rates, and increase origin traffic and latency.

Corporate Proxies, Link Headers, and Empty Responses

Meenan explains how some corporate proxies pass through encoding requests and then close connections when they encounter a response encoding they cannot handle. He describes Chrome’s planned rollout and a flag developers can use to test inside corporate networks. He also covers restrictions on dictionary-fetch hints in subresource headers and a Chrome error triggered by empty responses that declare dictionary compression.

Why Smaller HTML Can Improve LCP

Meenan argues that compressing dynamic HTML can improve Largest Contentful Paint on repeat navigations, while JavaScript deltas often save bytes without moving real-user metrics. He discusses compression overhead on fast connections and recommends using one dictionary for dynamic HTML where possible. He also explains changes to Chrome’s disk cache, when Chrome starts loading dictionaries for subresources, and the practical size limits of dictionaries.

Brotli Experiments and the Next Dictionary Features

Meenan revisits explicit dictionary lifetimes and explores sharing dictionaries across sites. His HTTP Archive experiment suggests stronger conventional Brotli settings could recover much of the potential savings from a large shared JavaScript dictionary. He reports CPU savings from narrowing where Brotli searches for matches and speed improvements in a Rust implementation of Brotli decompression.

Q&A on Firefox, Dictionary Updates, and Proxy Rollout

The Q&A opens with an update on Firefox’s rollout. Meenan explains how advertising one dictionary hash limits the number of cache variants and how a dictionary can compress its own successor. He clarifies that the proxy change would begin in Chrome Canary and move through the enterprise release process with a policy opt-out.

Pat Meenan has done amazing work over decades at companies like Facebook, like Cloudfair and especially at Google where he has contributed so many different performance features and standards to the Chromium engine. And that is not even mentioning the fact that Pat was the one who created and then also hosted for a very long time web page test which is still one of the best tools that we have ever had for web performance.

Right? So we owe Pat a huge debt of of gratitude. And this actually made it very difficult for me to figure out what pointer I should bring for Pat. Right? Because what do you bring for such an incredible and imposing figure? So I've eventually, I settled, I ended up settling for my my biggest, most impressive sword.

It's the biggest long sword I have. It's the Sigi Gothic Fader which I'm going to give to to Pat. There we go.

I mean it's alright but it's not a Lance.

There is no satisfying some people. Long sword is a weapon that like Pat, very consistently gets the hard jobs done in in impeccable amount of style. Okay. So Pat, I really wanna thank you.

Sorry. Yeah. PPK's freaking out as I'm swinging it around.

As I said to you before, that's PPK's problem. So Pat, let me thank you from the bottom of my heart for everything you do for our little, community and, very much looking forward to hearing more about compression on the web. Thank you.

Thank you. This is actually my favorite place. I look forward to this conference every year. So the Hallway Park Track, if you haven't seen my blue sky posts and everything else, the Hallway Track is absolutely my favorite talking to all of you, talking to... Just listening in on some of the conversations that you're having. It's the best place to learn and this is actually where we come up with most of the cool ideas that we roll out through the year. So thanks to all of you.

Now that you've had a nice lunch and you're settled in and relaxed, I thought I'd start with a nice calm conversation deep into the weeds of compression and l z 77 algorithms and so nap time. No. I'm kidding. But hopefully, that that sets a really low bar on expectations that I can meet at least.

I do wanna sort of set the stage with expectations that you are higher than I can reach with the sword. This is not an easy... So compression in general, when you're playing with it as a knob, and I'm gonna put this down before I break something that PPK cares about, like one of these screens.

Compression falls very much in line with protocol optimization and things like that, where it's not a low hanging fruit. It's not going to get you a 10 win if you flip a flag, for example. Right? If you've got a slow time to first byte, or if your BF cache is busted, or you don't have priorities on your images, you're lazy loading the wrong things, fix all of that first, please. Oh, yes. Thank you.

Let's maybe not do that. And here I thought going with slides would be the safer way. And this is what you get when you use a corporate laptop for presentations. So all of that stuff is like the basics in the lower layers here.

Compression, tuning, that kind of stuff, it's like one step short of ritual sacrifice when you're going to throw interns into the flames of make my site faster, please. It will get you that last hundreds of milliseconds maybe, if you're lucky. And that's the kind of numbers we're talking about here, right? Not big seconds. But it's where I like to play.

It's the exciting, hey, can we squeak that last bit of performance out of a site that's already really, really fast? And as, you know, someone was presenting earlier today, the the three megabyte average size of pages, and what was it, like 800 k compressed JavaScript, Those are compressed sizes.

Just to set your mental picture, that means like 10 megabytes of JavaScript uncompressed, 15, 20 megabytes of page actual content that the browser is parsing and executing on every page load. As we make compression better, that number might go down.

Odds are it's still gonna go up and there's just gonna be more stuff that ships. But it's critical to remember that the browser still has to run the uncompressed version of everything you send it. So even if we make your JavaScript files 1% the size that they were before on the wire, that's great. We saved some bandwidth.

We got a little bit of performance out of it. But the browser still needs to run all of that JavaScript. So listen to Alex when he yells at you tomorrow. Ship less JavaScript. But hopefully, can make what you do ship faster. And so the bulk of my talk is sort of a follow-up on compression dictionaries. If you're not familiar with them, I will go over what they are and how they work.

But this is something I've been working on for a few years, mostly with Yoav, and it's mostly his idea. I just helped bring it over the goal line and am a huge champion for pushing it forward. It's sort of the the follow on to what we were trying twenty years ago with delta compression. It was done very poorly back in the day and had all sorts of security problems with it.

This version has fewer, hopefully zero. But, you know, these days with AI, I'm not going to say zero. It will find a way, I'm sure. The way it works is any HTTP response that you serve today, doesn't matter how the browser gets it, can be used as a compression dictionary for any other response.

And what a dictionary is is just a reference of bytes. Compression, in general, works for looking for similar content, similar strings of bytes in things that it has seen before. And it goes, oh, instead of this long string of text, I'll replace it with a little pointer that says, yeah, this is all the same as that thing that you saw before.

And the dictionaries are just a giant index of things that it can consider as it has seen before. And so any response can be used as a reference for any future response. That's done with a header, just a use this dictionary header, and it gives... It has some properties that you can give it to say what kinds of requests this dictionary is good to be used for.

It can be used for navigation requests. It can be used for all requests. It can be used based on URL patterns to say, hey, apply this dictionary to everything with like a dot JS extension if you want, for example. Then the browser, it will run an algorithm when it makes every fetch request and go, hey, do I have a dictionary that matches the URL that I am about to send out?

If there are multiples, because let's say you serve 10 different dictionaries with 10 different match patterns, it'll pick the one that has the best match. The longest pattern is what it amounts to, but the best dictionary for any given request. And it will only send one. But it will send to the server that says, here's a request.

I support dictionary compression. And by the way, I have this dictionary available. And then if the server happens to decide it wants to use that dictionary or it happens to have an asset that was compressed with that dictionary, it can send it back in DCB or DCZ format, which is dictionary compressed Brotli or dictionary compressed Z standard, which end up being much, much, much smaller, like on the order of 90% smaller than nondictionary compressed responses.

So the potential wins are big. But remember, we're talking big wins on little numbers. Bandwidth savings, bandwidth has never sort of been the big problem. Latency is kind of the big problem. Browser support, huge interest across the board. It has been shipping for about a year and a half, two years now in Chrome in some form or another.

It's been an RFC for about a year now. It's working its way through the w three c spec problem... Process. Freudian slip. That's mostly my fault. There's a back and forth on the review process with the specs and everything else. And I'm just very slow to respond because I really hate writing specs.

Luckily, AI is very good at that these days, and so I can enlist its help in writing things in the right format. But we will make it over the goal. We're very close on finalizing the fetch spec modifications for it. It's been in Firefox Nightly for a long time now. I don't want to guess, but probably close to a year, if I remember right. Behind a flag, I'm not sure what the launch plans are there. But it will launch at some point.

WebKit, Igalia was kind enough to provide patches to WebKit. They have landed as far as I know. I can't tell you what that means for Safari. Hopefully, means at some point. Safari is kind of a weird beast because on iOS and macOS, they use the system networking stack, not WebKit's networking stack.

And so patches to WebKit may have zero influence on what actually happens for Safari at the layers that we're talking about. But Safari has supported the process and is positive on the feature and have been asking questions about it, which gives me signs that they're at least paying attention to it.

But I can't tell you when you'll see it. There are largely two use cases that we think of for compression dictionaries. The easy case to explain and the one that we thought would have the most value is Delta update for a static asset, like your JavaScript bundles or your CSS bundles. You have one build.

I like to use the YouTube player, not just because it's huge and I don't understand why, but it's like a megabyte plus compressed, maybe multiples. And they update it on the order of daily. So that's a lot of code to ship to every user every day for a site that's visited very frequently.

The goal is you can send just the change, just the delta, if you use one version of the library as a dictionary for the next version. You're not shipping any extra bytes. They were gonna download that first version anyway when they visited the page. You can just say, hey, by the way, this URL is also a dictionary for anything else that has a URL that looks like my URL. And when it goes back the next day, you can say, hey, I had the version of this JavaScript from two days ago. Can you give me just the delta?

And that ends up cutting down the size of the YouTube player by 90 plus 98% sometimes when you actually do the delta compressions, which is, would think, a huge amount for a day to day visitor that visits frequently. In the rounding error of the number of bytes that a user watches a video on YouTube for, it's probably a rounding error.

So it's useful. I'm not sure how much it matters to the YouTube team, which might be why they haven't shipped it it yet. The other use case, which is a little harder to picture, but I think probably more valuable, is using dictionaries for dynamic content. This is where you build a dictionary custom for your...

Let's... For the the sake of this argument, say your HTML. All of the pages on your site tend to have a very similar structure. They have the same logo, the same header, the same menu structure, the same footer, the same classes, if you would, the same style of HTML that makes up the pages, you can take all of that common stuff, put it into a dictionary, pack it off to the side, and say, okay, when the user first arrives they really want me to log in, don't they?

When the user first arrives, we send it a link header. It could have just been a preload or a prefetch, but we actually have... There's a new link header that you can send that's compression dictionary, which is a copy of the preload code that is just called compression dictionary because any response can be a dictionary. We just needed a way to trigger it.

Compression dictionary link request just loads it as a low priority preload, if you would, where it'll wait until after the page has loaded before it triggers. So user visits your page, downloads the first HTML, and gets a hint that says, hey, by the way, while you're here, download this other dictionary that's useful for my site.

Browser, after onload, goes and fetches it. It gets the match pattern, and every future HTML page that you visit uses the dictionary. And all of the common parts of your page get stripped out from what gets delivered on the wire effectively. So you end up just shipping the page specific parts of the content. This is what Google Search actually uses these days, where even the logo for Google Search, which at one point was an SVG, then was made an external file so it could be cacheable, is now an v g again because now it is cacheable because the s v g itself is in a dictionary, even though it's in line in the page, which raises some interesting questions when we start talking about sort of the micro optimizations.

Do you inline everything and just put it in a dictionary and compress it out? It still needs to be parsed, but it's cached. Fun times anyway. You have options. This is an HTTP spec. It's not a browser spec. You can use it for native apps, even WebViews or non WebViews.

If you have APIs that speak HTTP, they can use compression dictionaries. We found it very useful. You just ship the dictionary with the app, and you announce it on the HTTP request that say available dictionary. Your standard web servers that already speak dictionaries can serve dictionary compressed responses to your native apps as well as your web pages.

So it's not a web specific thing. Where we stand on tooling and CDNs. So yes, compression is much easier when you can push a button and the CDN just does it for you. We are not there yet. We are... Oh. I have a reason to use the sword. We are here.

The CDNs today don't break dictionary compression, which you wouldn't think is a big thing to ask, but it's where we are. The dictionaries themselves use perfectly bog standard HTTP, very support, content encoding support are largely neutral for anything that's in the middle that doesn't care about content encodings.

CDNs historically care a lot about content encoding and compressions. And so they usually strip off all the accepting coatings and they do their own and then they recompress and talk to the browser. We are at least at the point now where all of the CDNs have a way for you to configure things if they don't do it automatically, where they will not break dictionary support on your site. So you can implement compression dictionaries on your origin and they will work through your CDN.

They will cache your dictionary compressed responses for you with the correct vary so that you can serve different dictionary compressed responses to different clients that have different dictionaries and nothing will break. Where we hope to get things soonish, and most of the CDNs in some form or another have some projects going on working on this kind of stuff, is to actually support generating the dictionaries and serving them directly from the edges.

You'll still have to do a little config to say, like, these are the URL patterns where I want dictionaries to apply, but then they will take care of all of the magic for you. Or you upload a dictionary for your dynamic content, and they will apply it for you. Where we hope to get eventually, and I know Cloudflare blogged it on their blog for their dictionary plans, so I can call them out, and hold them to the task, is the automagical push a button and get dictionary compression automatically where they will discover which resources they need to generate a dictionary for and which resources work well for deltas against each other and just automatically do it all for you. When we're there, hopefully you won't have to care about dictionaries at all and it will all just work.

Where we are today, you need to know everything that I just told you to actually deploy compression dictionaries. And so sort of a hybrid in the middle. You can roll your own of the second option on your own on the edge using the edge compute that the the different providers all have. Down at the bottom, I have a link to my Cloudflare worker, which is very generic.

It probably has bugs because I wrote it by hand before AI existed, and it could have made it much better. I can probably go back and clean it up a little bit. But what it does is you just give it a list of patterns and you give it a dictionary for your site and it will take care of doing all of the delta compression from one version of your JS to the other and for your dynamic content, all just using workers on the edge.

So it's sort of the hybrid of, you don't have to do a whole lot of work on your origin, you just give it a little config and it takes care of everything for you. Although you do have to pay for the compute on the edge. One thing to be very aware of, because this is probably the first thing that everyone bumps into when they're deploying and building compression dictionaries, is the DCB and DCZ file formats themselves or the stream formats are not what you get out of the Brotli or Z standard command line interface when you compress using a dictionary.

They have a header that goes in front of it that includes a magic byte. It's either four bytes or... Sorry. It's either one byte or two bytes for DCB or DCZ. And then it has a 32 byte hash of the dictionary itself. So that's an extra check to make sure that the client is decompressing using the same dictionary that the resource was compressed with.

And so it uses the header on the front of the stream to make sure that you aren't getting the wrong file accidentally. And those those... We call it the one header, but those two chunks of data are usually what people mess up the first time that they... Yeah, Robin's nodding his head because he called me out on it a lot too.

We have tooling that will warn you about this now. That's somewhat better. But if you just use Brotli or Z standard from the CLI or through the API, you won't get those headers. You need to append them to your stream responses. The command line tools, like I mentioned, they won't give you the headers. But Brotli itself, depending on what version you're using, will also not give you dictionary support at all.

It wasn't available with Brotli on day one. Z standard shipped day one with dictionary support. Brotli, was something that was added later. These days, there's enough vulnerabilities in anything that if you're not running the latest version, you're probably compromised anyway. So my guess is this is not a problem. You're probably going to be running the latest version, which has dictionary support, at which point it's not a problem.

Debugging and measuring in the field, resource timing, thanks to Yoav again and his AI tokens mostly. The content sizes and the content encoding in the resource timing fields in RUM advertise the correct content encodings and sizes for dictionary compressed resources, both from the cache and over the wire.

So hopefully you can see that from your field data. We have test tools, thanks to Robin harassing me, that you can run against your origin to make sure it's actually compressing things correctly and not miss missing on one of the the various ways that you can make it go wrong. And then within Chrome, if you want to do debugging, there is a net internals page that has a compression dictionaries, maybe it is called shared dictionaries, that has the details about all of the dictionaries that the browser knows about, what the match patterns are and things like that. Oh, we have seen things.

So over the last year, this is largely from working with people who have deployed dictionaries, or tried to deploy dictionaries, and had issues that they stumbled over. So it wasn't just Robin. Hey, you gave me a sword. I can pick on you. Historically, we've gone, hey, this JavaScript is immutable.

Cache it forever. The dictionary lifetime is tied to the cache lifetime of the response. And so if you're updating your JavaScript daily, for the love of God, please don't cache it forever, especially if you want to use it as a dictionary because what you end up with is a long tail of clients.

You get someone who hasn't visited your site in a year, for the love of God. Tell us your password. Oh, it doesn't need passwords. It just needs a two factor, which is why I did that because it will now at least stop asking me, hopefully. So what you end up with is someone visiting your site a year later that still has the version of JavaScript as a dictionary from a year ago, which is 365 versions of your site a year ago, requesting your new version of your JavaScript with that old one as a dictionary.

And at that point, you have two choices. You can either delta compress 365 versions of your JavaScript against every possible previous version that you've shipped since it previously expired. I haven't seen anyone who's willing to do that. Everyone's usually looking at like maybe two weeks of delta compressions.

Or you send it the original uncompressed response. The problem with that is you have to set very response headers on the available dictionary so that you don't accidentally poison your edge caches. And now all of a sudden, your CDN edge cache, it stores a different copy of the response for every variation that it sees. And now you have three sixty five different variants of the same file stored on your edge cache that's polluting your edge, and it's all of a sudden causing hit rate problems on your CDN content. So now, unfortunately, you have to be aware of your edge caches, your vary patterns, how much you're polluting them, because that can all influence your hit rate, and more importantly, the actual cache lifetimes that you want to be using on your resources that you serve, instead of just blindly setting everything to a year.

Yeah. So this is, I kind of went into this, this is the very available dictionary fallback dilemma where you store a variant of every response no matter what you send from the origin. Even if you send an uncompressed, it has no way of knowing this uncompressed response is the same as every other uncompressed response. All it knows is based on the available dictionary header, which you have as a variant.

And so you end up with hundreds of copies of the full uncompressed version of your resource, not even your tiny dictionary compressed response. The other thing with that long tail that you miss is you won't have a variant available on the edge for that user.

So it has to go back to the origin. At which point, you're either doing another s three bucket fetch or a recompression or serving the entire uncompressed version again. And you end up with a much longer response time for that one user because it couldn't be satisfied from the edge. This is a bit hand wavy because if you're doing the matching and pattern and dictionary stuff on your edge in a worker, then technically you're not going back to the origin.

But assuming you're doing your dictionaries stored pre compressed at the origin, for example, the misses from having available dictionaries long past what you actually serve ends up causing a lot of cache misses on your edge and going back to your origin a lot more than you would normally. And that increases your bandwidth, bills out of your origin, as well as causing slow responses for anyone that's in that long tail. So these are all caveats to be aware of.

I'm not trying to scare you away from using compression dictionaries. I still want you to use them. There is just a lot

of foot guns that you need to kind of

dance around and be careful with. Right now, like as of today, Chrome does not support compression dictionaries through a network middle box, a corporate proxy, if you would, mostly because there is a small number of corporate proxies that don't work correctly. They all work differently, or they are all broken in various different ways. But one of the very common ways that they are broken is the content encoding.

If they were to work correctly, what they would do is on outbound requests, they would rewrite the content encoding header for every request with the content encodings that they know and understand. And then on the response, they would process it accordingly on whatever they are looking for in your requests and responses. How they actually work is they pass through, or some of them, they pass through your content encoding headers request, sorry, accepting coding headers unmodified. And then when they see a response that includes something that they don't support, they close the connection and say, sorry, they're trying to smuggle something through the proxy.

Don't allow it. And so it would be very bad for Google search to break, for example. But we were in a situation where Google search hadn't launched to 100%, so corporations with busted proxies might not know that they're busted and we break some random website. As of last week, Google Search launched to 100% of desktop, even the fast connections, which is basically all the enterprises.

So the plan is to turn on dictionary compression even with middle boxes. When I get back to the office, largely landed in Chrome and put big giant warning announcements in the enterprise notes to say, hey, if Google search doesn't work, it's because your proxy sucks, and here's the enterprise policy to turn it off in Chrome until you get your proxy fixed.

But we needed the search hammer basically so that the IT departments would actually see that it's not working. Why this matters to you is if you're doing dev in a corporate environment and working on compression dictionaries and you're not seeing it work, it might not actually be turned on. You need to turn off a flag that says, I forget exactly, but it says something about trusted roots for compression dictionaries.

You need to turn that off so that it actually uses compression dictionaries in your corporate environment so that you can actually test your production deployments. Otherwise, it will look like you're doing a whole lot of work and the browser isn't even trying to use dictionaries. One of the privacy problems of the world.

We can only add the link header for compression dictionary to the main response, for the HTML response. Chrome is no longer supporting link rel fetches from subresource requests. So you can't fetch or trigger a dictionary fetch from a subresource response. So like your font server can't send a dictionary request for a font specific dictionary, for example.

You have to, if you're going to use headers, you need to do it on the main resource. You can still inject it into the HTML anywhere using the link tag, but on a header level. This applies beyond compression dictionaries, by the way. It's preload, prefetch. Anything that causes a connection or a fetch is no longer allowed in Chrome because of AI and privacy leak reasons.

Blame AI for everything these days. The other really weird edge case, and this is probably more of a Chrome bug that I need to fix than anything, is if your server says content encoding DCB or DCZ, but sends a zero byte response, like a two zero four, for example, where there's no response, Chrome will actually generate an error and it will say, there's no header on this response.

It's an invalid dictionary. Well, yeah, no kidding. There's no response. But something to be aware of, at least today until I get that fixed, is in Chrome, don't actually set dictionary compression unless you have something to compress and send. So I was saying earlier, we thought static would be the easy case to sell. It turns out the dynamic content is where the real big wins are.

Every page you visit when you navigate a site, the HTML is on the critical path of LCP. So if you can make that faster, you have made every page that the user visits in every session except for the first one faster. And you can get 20% to 50% compression, even for dynamic pages like HTML. And instead of getting the once in the session every month or every few days when the user visits on a JavaScript, which isn't in the critical path.

On the HTML critical path, you get it on every page load. So if something is going to impact your LCP, this is the one that's most likely going to impact it. Both will still help your byte servings, but if you care about the performance of the user experience, look more to the HTML dynamic compression than the delta updates, even though the delta updates is the easier one to understand.

It's also worth being aware that on fast connections, the compression takes slightly longer using a dictionary because it has a longer window to scan for matches. And if network... For the love of God. Now it's just mocking me.

There are cases where the network is not a bottleneck. And in those cases, very fast connections, very low latency, using dictionary compression can actually make things slower because of the added time for compression. Usually what works out there is to use a lower compression setting for dictionaries because you will still get much smaller responses than you would use for regular Brotli, for example.

If you use Brotli level five, maybe use Brotli level three for dictionary compression. Use as much as possible one dictionary for your dynamic HTML site wide. Chrome maintains well, implementation specifically.

You will get value in this anyway. Chrome has a memory cache for compression dictionaries. It will remember the last two that were used for navigation requests and it will keep those in memory and not have to load them from disk on every navigation. If you use more than the two slots, and usually for these it ends up being Google search plus one for your site, but even if you have two for your site, odds are you're still in good shape. Once you go past two, you start churning and you're loading a dictionary from disk on every navigation, at which point you're racing the user's disk against the network.

And as sad as it is, the disk does not always work against the network, especially on Windows. I'm trying to remember exactly what happened here. Oh, yeah. This is basically just the Delta compression case.

Even though we got 90% savings, most of the sites that we've seen experiment with using Delta compression for their JS resources don't see it improve or impact at all their run metrics, like any run metric that they look at, mostly because it's not in the critical path. But there are also some bottlenecks in just doing and loading Delta compressed resources resources that it ends up, yes, it saved a few bytes on the network.

It mattered zero for the consumer experience. Yeah. Because it's not on the critical path. One of those problems was, for complexity reasons, Chrome chose to store dictionary compressed responses uncompressed in the HTTP cache.

That's mostly because, let's say you're doing delta updates of your JavaScript library from version one to version two to version three. By the time you get to version three, if it was delta compressed with version two, which was delta compressed against version one, all of a sudden you've got a long chain of dictionaries that you need to use and that are dependencies to be able to decompress the third one. To eliminate that long dependency chain, we just stored it uncompressed and we don't have any dependencies.

The problem is loading uncompressed resources from disk is much slower than loading compressed resources from disk, and so your cache hits were slower. Thanks to the Edge team and Microsoft, they submitted a patch to have Chrome actually Z standard recompress the responses that we write into cache. So it still doesn't have any dependencies, but it's at least better. We'll tune the compression level to see what works well.

But that's just sort of one of the challenges with racing dictionary compression against what you were serving before. The other problem that we had that also impacted the subresource case was we were always racing dictionary loads against fetches to try and give the client as much time as possible to load from disk while it's racing the network.

Largely, that meant starting the dictionary fetch as soon as we knew we wanted a resource, which works great for HTML. For things that are coming from the cache, it's actually counterproductive to load the dictionary the same time that you're trying to load the resource from the cache for a dictionary that you'll never need because you're not going to do the network fetch.

So we moved the sub resource preloading of dictionaries to only be after a cache miss, which means we have less time for the race, but at least we're not racing against the resources that you care about. It's important to know there are size limits. Hopefully, we don't run into this for general web content. But once you get across 50 megabytes and the trending is not looking good, we might...

Do you have a year prediction? Hopefully, it's not next year we hit 50 megabytes. But mentally, picture around 50 megabytes, things stop working well for dictionaries. That matters more for big WASM apps, for example. Now it's just a joke. And it doesn't really matter, Brotli or Zstandard.

They have different reasons that the limit's around 50 megabytes, but 50 megabytes is a safe limit to keep in mind. Lots of cool things going on in compression though. It's not just dictionaries. So one of the things that we're experimenting with, I mentioned right now the cache lifetime is hard tied to the dictionary lifetime.

When we originally wrote the spec, we actually had a TTL parameter to set an explicit dictionary lifetime. It's looking like that might have been a better idea, or at least a good idea to offer. So we're looking at maybe having a use case for bringing that back. We can share pervasive dictionaries across sites.

That probably doesn't matter for a lot of people, but if you have a hugely popular third party library, like let's say Google Analytics, it'd be nice to be able to delta update Google Analytics going from site to site without having to always navigate the same site. One of the experiments that I ran, because I got really excited, you know, we've had this this long running, why don't we just ship the popular JavaScript libraries with the browser and not have to worry about it? That's always been a problem that you had version explosion. Well, yes, everyone uses jQuery, but they all use different versions of jQuery. So what version do we ship?

Dictionaries largely solves that problem because all versions of jQuery largely compress well against the latest version because they're kind of iterated and grown from that. So I took a look and scanned the entire web as part of the HTTP archive, pulled down all of the JavaScript, all of the HTML, pulled out all of the functions, built a 100 megabyte dictionary or 50 megabyte dictionary because, you know, 50 megabytes is the useful cap, and said, okay, if we ship this 50 megabytes of common JavaScript code from across the web, how much smaller can it be? And so the the middle line is Brotli 11.

The bottom line is using the 50 megabyte dictionary. And yes, we could save another 11 percentage points off of the the size. That's, 50% smaller almost versus the Brotli 11. That's huge. Then I just compressed the resources with Brotli 11, and we got almost all of the savings.

And it turns out that, yes, dictionaries with a well known dictionary might get us most of the way. But actually just compressing the resources we serve today would get us most of the way there too. So more of the problem is that we're just shipping Brotli one, for example, to say that we're shipping Brotli compressed responses. Something you could do today is just turn that dial up a little bit, at least, and start shipping smaller responses.

And you don't have to worry about dictionaries. Played a bunch of experiments with, hey, what can we do to make dictionary compression faster? No reason so this is a search use case, for example. But you don't have to scan a compression dictionary for something that you know is not going to be compressible. So maybe we create a version of Brotli that doesn't scan for base 64 matches in a dictionary.

And that saved enough time to make up and let search ship for all desktops, for example. But we also... So a separate experiment I ran was, hey, right now compression is completely stateless and starts from scratch every time. What if we could give it some information about previous compressions?

Where does it spend its time? What can it optimize for? And most of the time goes into matching and looking for matches in the window. What if we could say, hey, these are the places in the dictionary where the useful content for looking for matches are. This is where you find them. Beyond these, don't look at anything else.

And we could actually get... At the exact same size, we could get 20% to 30% CPU improvement. If we say, hey, within 3% of the target, we could actually save 45% of the CPU on Brotli compression just by giving it some state information. And at this point, dictionary compression is actually faster than not using dictionary compression at all.

And so if you're serving stuff these days with AI, there's no reason not to roll your own is basically what it comes down to. Don't get... Feel like you're stuck with what comes out of the box for any of these things. You can actually tune the compressors for your use case and end up getting a lot of savings.

Similar on the decompression side, for reasons of CVEs and other things, there's been interest in shipping a Brotlie version of Rust. That was a concern because it was a lot slower, pointed AI at it for a weekend, I want to say, and managed to get the Rust implementation of Brotlie to be faster, five to 25% faster than the C implementation.

So there is a lot of meat left on that bone as well. And I think that is basically it. There is, As you've seen, there's still a lot of work to do to hopefully make this easier for everyone. I'm happy to answer any questions that you might have if you're doing manual deployments. Really looking forward to getting the turnkey CDN support.

All you CDN vendors, I know you're all here. The deck has a bunch of links to the tools and stuff, but that's it. So thank you.

Fantastic. As expected that fully delivered on all my expectations except of course that you weren't able to hold on to the sword for the full forty minutes. Yeah. But I forgive you. I forgive you.

Feels like now is a good time

Oh.

For a sword. So about those questions. So...

Alright. So congratulations. We actually got the most questions, of any talk today for you. Some of them are actually pretty, interesting as well. But firstly, there was also an instance of mansplaining.

Uh-oh.

Actually two instances of mansplaining because two separate Firefox people reached out to me. Uh-oh. Doing it well actually, apparently dictionary depressions are in Firefox, partial rollout as of one five three and they will be fully supported in one six one which launches November 24.

Awesome. Next week. That is huge Yes. Thank you. So

I I forgive that kind of mansplaining, I would say. Ryan Thompson had a very good question. What is the basic reason why you're only sending one matching dictionary hash instead of everything that the browser has available?

So remember the the very cache pollution problem? It gets exponentially worse when you have two hashes, three hashes, four hashes because you're doing a combinatorial explosion on the very. So if the available dictionary has to match on... Let's say user a has two possible dictionaries with two different hashes and user b has two possible dictionary matches, all of a sudden you've got four combinations.

Right? And so you get an explosion on the very key. So one was picked explicitly to minimize the risk of explosion explosion in the very cache.

Okay. That makes sense. Akamai still doesn't support very properly so that's why I didn't pick up on that. Christian had a very good inception alarm. Can you use dictionary compression to compress updates to your dictionary? Yes. Compressed dictionary.

Absolutely. So as long as your dictionary fits into the match pattern for what you want the dictionary to be used against. So let's say you just have a dictionary that goes to slash star and doesn't care about the fetch type. Or if it if it if it sets the fetch type to be navigation or sorry, I guess it's document, frame, and compression dictionary, then it will apply to every fetch for navigations, as well as compression dictionaries. And so yes, the the dictionary itself can be used as a dictionary for the next version of the dictionary.

I am gonna pretend like I followed that. Yes. Last question. Which is a very good one that that I also wrote down. From Eric Witt. Because you talked about switch, just switching on DCB next week for corporate proxies that might break Google search but won't that break every other site that is using DCB at this

point? So when I say switching on, I mean landing as enabled by default in Chrome in Canary, which then goes through the enterprise release process where they have to test and adopt and through beta and four weeks now, I guess it is the the cycle before it ends up. And even then, corporations may not roll out on the same schedule, but the the goal is for them to have plenty of time to see it break before anything actually breaks.

And trust me, you'll be a lot happier having search in the mix as something that breaks than just whatever sites you have deployed compression dictionaries on because then you would be getting random breakage. My guess is they will notice if Google search breaks.

That that is a very good point.

And that's assuming they ignore the release notes which I'm assuming they ignore.

I'm pretty sure they do. I do like that you're you're taking that initiative and being just like, I'm gonna enable it and it's your problem now. Just just We

give them a knob, right? Yeah, yeah. They can turn it off but

It's it's very good. So again, thank you so much Pat. Not just for the talk but for everything you do. Super interesting. A final applause please.

Compression on the web
2026 edition

A lizard runs along a winding desert road while a fox reads a scroll labeled RFC 9842.

The Last 5–10% of Web Performance

  1. TTFB
  2. The OG basics: “High Performance Web Sites”
  3. Application architecture
  4. Request scheduling
  5. Protocol tuning & Compression
  6. Ritual sacrifice

A climb up a volcano represents increasingly advanced performance work. The path starts at a gate flanked by clocks, then passes a beach, a construction site and a bridge with a traffic signal. An arrow highlights protocol tuning and compression, where a fox scales the rock just below a lizard holding up a floppy disk at the summit.

The Last 5–10% of Web Performance

  1. TTFB
  2. The OG basics: “High Performance Web Sites”
  3. Application architecture
  4. Request scheduling
  5. Protocol tuning & Compression
  6. Ritual sacrifice

A climb up a volcano represents increasingly advanced performance work. The path starts at a gate flanked by clocks, then passes a beach, a construction site and a bridge with a traffic signal. An arrow highlights protocol tuning and compression, where a fox scales the rock just below a lizard holding up a floppy disk at the summit.

Total Bytes P50

Desktop and mobile median page weight in KB.

Ethan Gardner, An Objective Analysis of AI’s Impact on Page Weight (May 2026)

Both lines trend upward from late 2019 into 2026. Desktop stays above mobile throughout, rising from about 2,000 KB to about 3,000 KB. Mobile rises from about 1,800 KB to about 2,600 KB. Vertical markers show dates of AI model releases.

Compression Dictionaries

A fox studies a dictionary blueprint at a drafting table while a lizard peeks out from behind a cactus.

Any* HTTP response can be a dictionary

  1. Use-As-Dictionary: match="/app.*.js"
  2. Available-Dictionary: :sha256:
    Accept-Encoding: gzip, br, zstd, dcb, dcz
  3. Content-Encoding: dcb

The server sends a response that the browser can store as a dictionary for matching JavaScript URLs. On a later matching request, the browser advertises the dictionary by its hash and lists the encodings it accepts. The server then sends a response compressed with that dictionary using Brotli.

Browser support

  • Chrome: 130+
  • Firefox: Nightly, config flag
  • Safari: WebKit patches

The Chrome dinosaur reaches a finish line marked 130+, a fox operates a Nightly switch for Firefox, and a rabbit works from a blueprint beside an Igalia toolbox for WebKit.

Delta updates for static assets

  • app.v1.js: 500 KB (cached)
  • 30 KB delta, Content-Encoding: dcb
  • app.v2.js: 510 KB

70–90% byte reduction for returning visits after deploy.

A diagram adds the downloaded 30 KB delta to the cached 500 KB first version to reconstruct the 510 KB second version.

Dynamic content (dictionary on the side)

  1. Page 1: Idle fetch
  2. dict.dat: HTML shell + SVGs
  3. Page 2+: 20–50% smaller HTML
<link rel="compression-dictionary" href="/dict.dat">

The first page fetches the dictionary during idle time. On later pages, the dictionary supplies the shared page structure so the browser can reconstruct the full HTML from a smaller response.

Hybrid and native app traffic

Web Hybrid

Landing bundle compresses follow-on navigations.

Native Mobile Apps

Pre-shipped in app binary. Works on request #1.

Puzzle pieces in a browser illustrate reuse of the landing bundle on later navigations. A dictionary inside a phone illustrates how a native app can ship with the dictionary already available for its first request.

CDNs, Platforms, and Tooling

A fox on rocket skates chases a running lizard across the desert.

CDN support

  1. Passthrough (Today): Cloudflare, Akamai, Fastly, Cloud(s)
  2. Edge-Hosted Dictionaries and Config (Soon)
  3. Auto-magical

An open gate represents passthrough. A dictionary in a cloud sending out responses represents edge hosting. An on switch represents automatic configuration.

Roll your own at the edge

  • Browser: Available-Dictionary
  • Edge Worker + Cache: Compresses dcb / dcz
  • Origin: Zero changes

github.com/pmeenan/dictionary-worker

The browser exchanges requests and responses with an edge worker and cache. The worker contacts the origin and handles dictionary compression at the edge, so the origin requires zero changes.

Prepending the dcb and dcz headers

dcb (36 B)

  1. 4B Magic: 0xFF 'D' 'C' 'B'
  2. 32B Dictionary SHA-256 Hash
  3. Raw Brotli Stream

dcz (40 B)

  1. 8B Skippable Frame: 5E 2A 4D 18 20 00 00 00
  2. 32B Dictionary SHA-256 Hash
  3. Raw Zstd Stream

Both diagrams place the dictionary hash immediately before the compressed stream. The Brotli variant starts with a four-byte signature, and the Zstandard variant starts with an eight-byte skippable frame header.

Runtime and library support

Zstandard (dcz)

Built-in from day one. CLI & language bindings.

Brotli (dcb)

Recent builds (1–2 yrs). node:zlib • php-ext-brotli

A check mark denotes Zstandard’s built-in dictionary support. A clock denotes Brotli’s later addition of dictionary support.

Debugging and measuring in the field

RUM in Field

ResourceTiming.contentEncoding

Validators

Inside Chrome

  • net-internals
  • DevTools headers

A speedometer represents real-user monitoring. A magnifying glass over a blueprint represents validation, and a browser window with gears represents Chrome’s debugging tools.

Oh, the things we have seen!

A fox on rocket skates reaches the edge of a canyon while a lizard waves from across the gap. A broken rope bridge and hazard signs foreshadow deployment pitfalls.

The “cache it for a year” trap

  • max-age=31536000, immutable: 1-year cache vs. daily code deploys
  • Dictionary TTL = Cache TTL. Match release cadence (days / weeks).

A long bar represents a one-year cache lifetime, and a shorter bar represents a lifetime measured in days or weeks. A stack of year-old crates teeters on a bucket labeled LRU cache.

The “cache it for a year” trap

  • max-age=31536000, immutable: 1-year cache vs. daily code deploys
  • Dictionary TTL = Cache TTL. Match release cadence (days / weeks).

A long bar represents a one-year cache lifetime, and a shorter bar represents a lifetime measured in days or weeks. A stack of year-old crates teeters on a bucket labeled LRU cache.

The Vary: Available-Dictionary fallback dilemma

  • Omit Vary on miss → Cache poisoning
  • Cache every missed hash → Cache pollution
Vary: Accept-Encoding,Available-Dictionary
CDN-Cache-Control: no-cache

A train emerges from a tunnel as a fox holding a paintbrush scrambles away, illustrating an unexpected fallback hazard.

Watch out for origin storage RTT on misses

  • Edge cache hit: 2 ms
  • Unknown hash → S3: 246 ms p90 (S3 lookup miss)

Edge hash allowlist (or negative cache)

The bar for an S3 lookup miss is much longer than the bar for an edge cache hit, showing the latency cost of checking origin storage for an unknown dictionary hash.

Middleboxes and corporate TLS proxies

  • Reverse proxies strip dcb & dcz from Accept-Encoding.
  • Dictionaries disabled on non-public HTTPS roots (Chrome).

Scissors cutting a strip of paper illustrate a proxy removing encodings from a request header. A chained and padlocked dictionary represents Chrome disabling dictionaries for connections that use non-public HTTPS roots.

No more Link headers on subresources

Subresource XHR / fetch() headers

Link: </dict.dat>; rel="compression-dictionary"

Document HTML / DOM

<link rel="compression-dictionary" href="/dict.dat">

A cross marks the subresource response header. A check mark identifies the document’s HTML link as the supported way to trigger the dictionary fetch.

When framing goes wrong

Content-Encoding: dcz + 0-byte / unframed stream

ERR_CONTENT_DECODING_FAILED (-388)

  • match-dest=("document")
  • Network Error Logging (NEL)

A cross marks the decoding failure. Check marks identify restricting the dictionary match to document requests and using Network Error Logging to detect failures.

Dynamic HTML vs. Static Delta in the Field

A lizard runs along a road marked Dynamic HTML while a fox is caught in a coil beside a Static Delta sign.

Dynamic HTML is where the top-line wins are

20–50%+ smaller HTML
Consistent FCP & LCP wins

  • Daily dictionary rotation → Low repeat hit rate
  • Monthly dictionary rotation → High hit rate

An arrow connects a block representing the full HTML payload to a smaller block marked −50%, illustrating the reduction in bytes transferred.

Dynamic HTML vs. Static Delta in the Field

A lizard runs along a road marked Dynamic HTML while a fox is caught in a coil beside a Static Delta sign.

Dynamic HTML is where the top-line wins are

20–50%+ smaller HTML
Consistent FCP & LCP wins

  • Daily dictionary rotation → Low repeat hit rate
  • Monthly dictionary rotation → High hit rate

An arrow connects a block representing the full HTML payload to a smaller block marked −50%, illustrating the reduction in bytes transferred.

Server compression CPU vs. network RTT

Mobile & p75/p90

Bytes saved >> Server CPU. Clear latency win.

Low-RTT Desktop

+40% Brotli CPU cost. Drop to q3–q4 or Zstd.

A check mark identifies the latency gain on mobile and at the 75th and 90th percentiles. A clock flags the extra compression time on desktop connections with low round-trip latency.

Use one site-wide HTML dictionary

  • RAM Slot 1: Search Engine
  • RAM Slot 2: Your Site (/*)
  • Per-Route Dicts: Evict to slow disk!

Two memory slots hold dictionaries for a search engine and the site as a whole. An arrow points from memory toward disk storage, illustrating how additional per-route dictionaries can cause eviction from memory.

The static delta paradox

  • −60% to −90% Wire Transfer Bytes
  • Flat CWV Warm Loads in Field

Still optimizing (browser and sites)

A crate, a scale, a downward arrow, and a feather represent the reduction in bytes transferred. A stopwatch with a question mark represents the lack of improvement in Core Web Vitals on warm loads measured in the field.

Chrome was storing dcb responses uncompressed on disk

  • 30 KB → 500 KB on Disk Uncompressed!
  • 30 KB → 130 KB Zstd

HttpCacheZstdCompression (crbug.com/380957720)

Two paths show the same 30 KB response stored first as 500 KB of uncompressed data and then as 130 KB using Zstandard. A boulder towering over a disk-cache bucket illustrates the expansion after decoding.

Preloading dictionaries before checking the cache

Subresource → Read Dict from Disk → Already Cached!

Wasted disk I/O contention on warm loads

Preload ONLY on main Document requests

CompressionDictionaryLimitEarlyMatching

A cross marks the path that reads the dictionary from disk before discovering a subresource cache hit. A check mark identifies the change that limits early dictionary preloading to main document requests.

Large WASM and format size limits

  • Brotli Cap — ~56 MB max dict
  • Chrome Limit — 100 MB (raised for 75+ MB WASM)
  • Zstd 128 MB Shared Window — 76 MB Dictionary, 52 MB Output

Past 52 MB output, start of dictionary slides out of window!

The diagram compares Brotli’s dictionary cap with Chrome’s raised limit. A segmented bar shows that a 76 MB dictionary leaves 52 MB for output in Zstandard’s 128 MB window. As output grows beyond that point, the start of the dictionary moves out of reach.

Large WASM and format size limits

  • Brotli Cap — ~56 MB max dict
  • Chrome Limit — 100 MB (raised for 75+ MB WASM)
  • Zstd 128 MB Shared Window — 76 MB Dictionary, 52 MB Output

Past 52 MB output, start of dictionary slides out of window!

A segmented bar shows a 76 MB dictionary and 52 MB of output fitting together in Zstandard’s 128 MB window. Additional output pushes the beginning of the dictionary out of the window.

Moar Experiments!

A fox in a lab coat points to a magnet and a catapult on the A.P.E.X. Lab chalkboard, introducing the experiments section.

Decoupling dictionary TTL from Cache-Control

Use-As-Dictionary: match="/app.*.js", ttl=604800

Static JS

  • Cache-Control: 1 Year (immutable)
  • ttl: 7–14 Days

Dynamic HTML

  • Cache-Control: no-store (0s)
  • ttl: 5 Minutes

Paired bars show independent cache and dictionary lifetimes. The static JavaScript dictionary expires sooner than its cached response, while the dynamic HTML example gives the dictionary a five-minute lifetime alongside a zero-second cache lifetime.

Moar Experiments!

A fox in a lab coat points to a magnet and a catapult on the A.P.E.X. Lab chalkboard, introducing the experiments section.

Decoupling dictionary TTL from Cache-Control

Use-As-Dictionary: match="/app.*.js", ttl=604800

Static JS

  • Cache-Control: 1 Year (immutable)
  • ttl: 7–14 Days

Dynamic HTML

  • Cache-Control: no-store (0s)
  • ttl: 5 Minutes

Paired bars show how an explicit dictionary TTL can be shorter than the cache lifetime for immutable JavaScript and longer than the cache lifetime for dynamic HTML.

Sharing pervasive dictionaries across sites

  • Site A
  • Site B
  • Site C

Pervasive Cache Dictionary Sharing

Shared 3P scripts across origins (when 3P cookies enabled)

Arrows from three browser windows converge on one dictionary, illustrating how different sites could reuse a compression dictionary for a common third-party script.

“Why not just ship React with Chrome?” (Part 1)

  • Uncompressed — 100% (Raw JS / HTML)
  • Served Today — ~32% (gzip / br)
  • 50 MB Dict + br 11 — 19%!

Three bars compare response sizes as percentages of the raw JavaScript and HTML. A wagon stacked with books labeled React, jQuery, Vue, and Lodash represents a 50 MB dictionary built from common JavaScript libraries.

“Why not just ship React with Chrome?” (Part 1)

  • Uncompressed — 100% (Raw JS / HTML)
  • Served Today — ~32% (gzip / br)
  • 50 MB Dict + br 11 — 19%!

Three bars compare response sizes as percentages of the raw JavaScript and HTML. A wagon stacked with books labeled React, jQuery, Vue, and Lodash represents the 50 MB dictionary.

“Why not just ship React with Chrome?” (Part 2)

  • Uncompressed — 100%
  • Served Today — ~32%
  • Plain brotli -11 — 22% (No Dict!)
  • 50 MB Dict + br 11 — 19%

The added bar for Brotli level 11 without a dictionary reaches 22% of the original size, only three percentage points above the result using the 50 MB dictionary.

Don't scan an HTML dictionary for Base64 images

  • <head> & HTML Shell — Use Dictionary
  • data:image/jpeg;base64 — Skip Dictionary!
  • HTML Body & Scripts — Use Dictionary

A three-part HTML diagram marks dictionary matching for the head and shell, skips matching for an embedded Base64 JPEG, and resumes it for the body and scripts.

Where does Brotli encoder CPU actually go?

  • Sliding Window & Hash Inserts — 40–50% of Encoder CPU
  • Dictionary Lookup (up to 32 hits/bucket) — ~30% of Encoder CPU
  • Entropy Coding — ~10%

Three bars show that sliding-window work and hash inserts consume the largest share of encoder CPU among the operations listed, followed by dictionary lookup and entropy coding.

Sparse window inserts (−9% CPU for free)

  • Standard Brotli (64+ byte copy): hashes EVERY byte (0..63+)
  • Sparse Inserts: hash first 16 bytes, skip interior (16..63+)

−9% Total Encoder CPU • < 0.1% size cost

Two rows of blocks show hash coverage for a long copy. The standard approach inserts hashes at every byte position, while sparse inserts cover only the first 16 positions.

Learning which dictionary offsets actually get used

  • Top 1–16 Offsets Kept
  • 2/3 of Offsets Never Used (Pruned from depth 32)
  • 8 misses → step every 2nd byte
  • Window match >= 32B → skip dict

Two blocks distinguish retained offsets from unused offsets pruned from the index. Check marks identify two ways to reduce lookup work by stepping every second byte after eight misses and skipping the dictionary when the window already provides a match of at least 32 bytes.

20–30% less server CPU at the exact same size

  • Standard Brotli + Dict — 100% Server CPU (Baseline)
  • Learned Index (0% size) — −20% to −30% CPU (Same size!)
  • Relaxed (+3% size) — −45% Server CPU

The bars compare server CPU use with standard Brotli dictionary compression. The learned index reduces CPU use at the same compressed size. The relaxed setting saves more CPU with a 3% increase in compressed size.

Pointing AI agents at the Rust Brotli decoder

  • Old Rust Crate — 0.75x (Slower than C)
  • C Reference (cbrotli) — 1.00x Baseline
  • AI-Optimized Rust (~3 days) — 1.10x–1.25x (10–25% FASTER than C!)

Three bars show the Rust decoder moving from below the C reference speed to above it after about three days of AI-assisted optimization.

Pointing AI agents at the Rust Brotli decoder

  • Old Rust Crate — 0.75x (Slower than C)
  • C Reference (cbrotli) — 1.00x Baseline
  • AI-Optimized Rust (~3 days) — 1.10x–1.25x (10–25% FASTER than C!)

Three bars show the Rust decoder moving from below the C reference speed to above it after about three days of AI-assisted optimization.

Whole-file compression benchmarks lie

  • Single Whole-File Contiguous Buffer
  • ~1.5 KB → ~1.5 KB → ~1.5 KB → ~1.5 KB

Web Streaming: packet flushes & Time-to-First-Chunk

A cross marks the benchmark that processes a file as one buffer. A check mark identifies a sequence of roughly 1.5 KB chunks, illustrating a streaming benchmark that accounts for packet flushes and the time until the first chunk.

Still Lots of Work to Do

A fox in a hard hat studies a plan beside a lizard as a pixelated dinosaur drives a road roller through a construction zone.

What the ecosystem still needs

  • Turnkey CDNs
  • Stable Bundlers — Consistent chunks
  • Server Modules — Nginx & Apache
  • Web Streams — Brotli API parity

A globe with antennas represents CDN support, a package made of puzzle pieces represents consistent bundle chunks, a plug in a gear represents server modules, and a running tap represents web streams.

And That’s a Wrap!

pmeenan@google.com · @PatMeenan, @patmeenan.com

blog.patrickmeenan.com

A fox waves and holds a pennant marked dcb while a lizard perches above it in a cartoon closing card.

People

  • Yoav Weiss

Technologies & Tools

  • Chromium
  • WebPageTest
  • JavaScript
  • Brotli
  • Zstandard
  • WebKit
  • jQuery
  • Rust

Standards & Specs

  • HTTP
  • Use-As-Dictionary
  • DCB
  • DCZ
  • Fetch Standard
  • HTML
  • SVG
  • Available-Dictionary
  • Accept-Encoding
  • Vary
  • Resource Timing
  • WebAssembly

Concepts & Methods

  • LZ77
  • Time to First Byte
  • Back/forward cache
  • Compression dictionaries
  • Delta compression
  • Real User Monitoring
  • Largest Contentful Paint

Organisations & Products

  • Chrome
  • W3C
  • Firefox Nightly
  • Igalia
  • Safari
  • YouTube player
  • Google Search
  • Cloudflare Workers
  • Amazon S3
  • Microsoft Edge
  • Google Analytics
  • HTTP Archive