Does it help to use subdomains for image and javascript hosting?

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.
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)?

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:
If Cloudflare already uses http2
I don't think they already support HTTP/2.
then is there any need to setup subdomains?
If you use SPDY or HTTP/2 no need really for extra sub domain or domain.
It will just harm you by adding extra http request, domain resolution, ssl certificate.

Also, doesn't http2 require the site to be served over HTTPS?
Yes.

If my site is http, then will I see a performance boost by converting to HTTPS and enabling sdpy/http2?
HTTP/2 > SPDY > Plain HTTP > SSL/HTTPS without SPDY or HTTP/2
My past experience has always been that SSL slows down the website.
Not anymore after SPDY was introduce..
 
To add to the above:

Can you explain why a separate domain is better than a subdomain?
This may not matter on SPDY/HTTP2, but traditionally it was because if you run your installation on the base domain (no www), cookies get set on it and all sub-domains. Cookies have to be transferred back and forth for every request, so using a separate domain would enable your static resources to be served without transferring cookies.

Is there a reason I should only send js and data to Cloudflare instead of everything (wouldn't CSS benefit from CDN as well)?
CSS is served dynamically via PHP, and thus can't be served over a CDN.
 
but traditionally it was because if you run your installation on the base domain (no www), cookies get set on it and all sub-domains. Cookies have to be transferred back and forth for every request, so using a separate domain would enable your static resources to be served without transferring cookies.
This is the only advantages of having a sub domain as far as I'm aware :).
CSS is served dynamically via PHP, and thus can't be served over a CDN.
BDCache addon can be use to serve it as static file/cdn.
 
but they are not an .rpm file either. Can you provide me some guidance?
  1. Wait until your OS distributor is supporting it directly in their repository
  2. Find a repository that already has it included (again, depending on your OS)
  3. Compile manually and deal with the headaches of doing it from then on.

Me, I'd do either 1 or 2. Don't know what OS you are running, so the repositories are varied for Debian or CentOS.
 
based on his previous post looks like Centos :).
I don't think CentOS is the only one that uses yum.
I know Fedora, CentOS, and RedHat do... but I'm not really sure that all the repositories are the same for them.
I believe that any RPM based OS can utilize YUM and not all of them are interchangeable on their repositories, so basing the OS off the fact it uses yum is not very assured. For some reason, I'm thinking (been a while since I used it) that Mandriva and SUSE linux utilized the RPM package format also and were able to use the Yellowdog Updater Modified (in other words, YUM).
 
Last edited:
I don't think CentOS is the only one that uses yum.
I know Fedora, CentOS, and RedHat do... but I'm not really sure that all the repositories are the same for them.
I believe that any RPM based OS can utilize YUM and not all of them are interchangeable on their repositories, so basing the OS off the fact it uses yum is not very assured. For some reason, I'm thinking (been a while since I used it) that Mandriva and SUSE linux utilized the RPM package format also and were able to use the Yellowdog Updater Modified (in other words, YUM).
I am using Centos. I guess I'll just hold off then because I don't want to be stuck manually doing it. Maybe I'll install spdy in the interim.
 
I am using Centos. I guess I'll just hold off then because I don't want to be stuck manually doing it. Maybe I'll install spdy in the interim.
I haven't found any that have the latest of Apache in it (they typically run a little behind).
Have you giving thought to using @eva2000's CentMin Mod since you are running CentOS? It will allow you to use nginx (which is a MUCH better HTTP server than Apache) along with MariaDB and the latest PHP versions before they are in the repositories. It compiles the code locally for you, which in turns means you get the latest in a streamlined process that is easy to do.

Most of my other sites were Debian based, but I have consolidated them into CentOS and strictly use CentMin now.
 
I haven't found any that have the latest of Apache in it (they typically run a little behind).
Have you giving thought to using @eva2000's CentMin Mod since you are running CentOS? It will allow you to use nginx (which is a MUCH better HTTP server than Apache) along with MariaDB and the latest PHP versions before they are in the repositories. It compiles the code locally for you, which in turns means you get the latest in a streamlined process that is easy to do.

Most of my other sites were Debian based, but I have consolidated them into CentOS and strictly use CentMin now.
I'll take a look at that.
 
Now I'm trying to setup HTTPS, but I am finding that I get a lot of content loaded in the threads from insecure sources (http). I'm not sure how to correct that because most of the content is user images, signature lines, etc. How do I get around this? It seems that Xenforo has done it.
 
Now I'm trying to setup HTTPS, but I am finding that I get a lot of content loaded in the threads from insecure sources (http). I'm not sure how to correct that because most of the content is user images, signature lines, etc. How do I get around this? It seems that Xenforo has done it.
If you change your board URL to HTTPS and enable Image Proxy, all of that issue will be solve.
 
0
Otherwise it will delete the cache.
So it has been working so far, but I ran into an issue where one .gif isn't being picked up by the proxy.

BPENA.jpg


Code:
Mixed Content: The page at 'https://stratics.com/threads/poll-location-of-tol-forum.353230/#post-2610931' was loaded over HTTPS, but requested an insecure image 'http://stratics.com/community/data/images/smilies/eyetwitch.gif'. This content should also be served over HTTPS.

Any idea what might be causing that smiley gif to behave differently?
 
Any idea what might be causing that smiley gif to behave differently?
The size? Is it an animated GIF that exceeds the size limits you have set?

That's what happens when you start reading when first getting up.
As stated, you are linked via the HTTP, which appears to be a full link? Have you changed the URL in the ACP to reflect the HTTPS changeover?
 
Last edited:
Top Bottom