Ryan Nielson
Active member
If Cloudflare already uses http2, then is there any need to setup subdomains? Can you explain why a separate domain is better than a subdomain? Why not just send everything through a single domain via Cloudflare (root domain)? Is there a reason I should only send js and data to Cloudflare instead of everything (wouldn't CSS benefit from CDN as well)?If the only purpose is to score better on that site analysis test, I wouldn't bother. Since you're switching in the near future to the newer protocols, it'll very much be a waste of time.
On the other hand, if you want to offload your static assets (images, javascript, etc) to a content distribution network such as CloudFlare, Amazon CloudFront, or MaxCDN, then I would recommend creating a new domain, or using a subdomain of your existing domain for that. You'll only need one domain (or subdomain) for it, since CloudFlare currently uses SPDY, and all the major CDN's will use HTTP2 in the near future. So instead of images.mydomain.com AND js.mydomain.com, you could just create static.mydomain.com. However the better alternative would be to create an entirely new domain just for the assets so it's cookieless.
Here's a good guide for using XF with a CDN. The key parts are under the heading "How To Add Your CDN in Xenforo Settings"
We use CloudFlare with a completely separate domain than our website, and they're able to cache on average > 87% of our static data requests (javascript, etc), so our server can use its resources for generating the php pages for the visitors.
Also, doesn't http2 require the site to be served over HTTPS? If my site is http, then will I see a performance boost by converting to HTTPS and enabling sdpy/http2? My past experience has always been that SSL slows down the website.
Last edited: