I’m trying to make HTTP/2 push work with Cloudflare and I’m struggling. I followed exactly this example /workers/examples/http2-server-push/ and it works fine with my free personal account. I can see in Chrome dev tools network tab that the initiator is “Push” and cf-h2-pushed header as well as I see PUSH_PROMISE when using nghttp.
When I try to do the same with another paid Cloudflare account (HTTP/2 is enabled), it doesn’t work at all.
Chromium and other browsers are not supporting it anymore, so even if you want it to work and Cloudflare would support it (which they don’t), then it would not work, because the browser does not support it anymore and therefore no client would be able to profit from.
But the good news is: there are “Early Hints”. Early Hints are the “replacement” for HTTP/2 Push & HTTP/3 Push. Early Hints are not as performant as HTTP Pushes, but are at least giving you a somewhat same experience.
The good part is: Early Hints are implemented the same way as HTTP/2 Push - over the link header.
Yes, this is a little mislabeled I would say, should have been named something with “EarlyHints”. Like mentioned before, the implementation header-wise is the same. But ofc this now will implement EarlyHints, not a HTTP/2 Push.
If you like to know how to check if EarlyHints are working, please check this post #342888/#12
Or use the tool I build and mentioned here: #342888/#17
Just paste the URL you want to check against and run it several times. If it once returns positiv, then it is active.
Well, I read about Google’s intention to stop supporting it in Chrome but I was a bit skeptical since I was able to make HTTP/2 push work with Cloudflare + Chrome like 1 hour ago (again, only with my personal free Cloudflare account).
I’ll consider “Early Hints”, I wasn’t aware of it, thanks for the tip.
Just tested - also works for me, but 100% sure I read, that the support for this was removed… now I have to do some research!
When they discontinued it, it was not working for me for quite a while, never tested it since then.
Besides that, I only read about the “intention” to remove, I couldn’t see any reference to “it’s already deprecated”. For it sounds my like some Cloudflare issue because when I use nghttp I can see PUSH_PROMISE but if I do the same to the other website (paid account), I can’t see it (and they have the exact same configuration). So it seems like Chrome is not showing the “Push” because Cloudflare is not actually pushing the content.
Just out of curiosity, can you test copying all files you want to push into the directory /http2_push/h2p/ and push them with their new link from here?
As the page you successfully could push served them from there and Cloudflare sometimes does have special directories. For example for hotlinking, where the directory, or directory name does apply certain functions.
If you want us to look into this, please provide a URL where it is implemented, but does not work.