Hi, I use a separate subdomain to serve static assets (a CNAME pointing to a Cloudfront distribution), but is this a good practice with Cloudflare, especially if I want to use server push?
I don’t exactly know all of the HTTP/2 spec and the implementations, but I believe that server push only works for resources on the same server as the one “pushing” them. It won’t work otherwise.
That is my exact understanding as well.
After all, you cant push something you do not have, and if you have it, it is not a third party resource. Assuming HTTP 2 supports pushing “redirects”, one could possibly push a 302 and count on the client’s cache, but I really cant tell whether that would work in the first place.
Looks like Cloudflare supports server push across subdomains, but I still haven’t tested it, though. Here’s what support told me:
Optimizing content delivery comes down to the time it take to process a request and the distance between the source of the request and destination.
My guess is using Cloudfront will help improve performance since the path from Cloudflare to Cloudfront is going to be closer in many cases compared to Cloudflare to S3, but regarding server push, both configuration does not affect the push functionality.
This topic was automatically closed after 30 days. New replies are no longer allowed.