cloudflare-docs
cloudflare-docs copied to clipboard
[Docs Site] Add link headers for 103 Early Hints
Example URL(s)
- https://developers.cloudflare.com/
Actual Behavior
No link headers.
Expected Behavior
All the link headers.
Additional information
cc @kodster28 @WalshyDev
Now that we have Early Hints enabled on the docs site, we can leverage 103 Early Hints to make the site super fast 🔥
Preloads
In my opinion, this would include:
- https://developers.cloudflare.com/home.css
- https://developers.cloudflare.com/search.redirect.min.826764246c0056e88cd0af076274b8d9.js
- https://developers.cloudflare.com/home.min.d720e27e667103421a4ba0e7d5a9c1bb.js

I haven't actually looked into what the JS does - or what any of the third party stuff does.
Since the JS is cache-busted with a hash, we'd need a post-build step to add them to the _headers file.
Preconnects
Important third party domains hosting assets:
- www.googletagmanager.com
Suggestions
Happy to hear any thoughts about if anything needs adding or removing - obviously with preloads, we want to keep it to the critical render path otherwise you'll defeat the benefit of stuff like lazy loading or deferring.
On another note, is the code block highlighting added through GTM? My fork doesn't have it and it looks ugly - but have never looked into why
If you're talking what I think you're talking about, you can preview code block highlighting by running npm run prebuild prior to npm run dev (and then run npm run postbuild afterwards to strip out all the highlighting).
Also, in terms of Early Hints, heard that we might actually get the Smart Early Hints mentioned by the blog relatively soon, so the links might get added automatically.
you can preview code block highlighting by running
npm run prebuildprior tonpm run dev

Ooooooooooooooooooooooo - thanks.
we might actually get the Smart Early Hints mentioned by the blog relatively soon
That'll be pretty cool when it lands - I'd be interested to see how they select which assets to add as hints but I guess that'll be covered in another blog post when it becomes available.
Yeah, and we'll be more than happy to provide feedback if it's not grabbing the right stuff, lol.
A requirement for working here is that you're pretty vocal (but friendly at the same time).
Addressed in the attached PR.