CDN

Jafo

Active member
Will there be any considerations for CDNs? I had to create a product for our sites to utilize origin pull over at Softlayer and even so, found it tricky to hook in everywhere I needed too (i.e. public attachments). Will there be any thought given to this in development?
 
hey thanks for the info
actually i've setup cdn with my wordpress site by using W3 total cache and it's easy because there's an option there to choose Amazon CloudFront with a click of a button after I've setup my "origin pull"
So in this case after i've setup cloudfront pull how do I configure my xenforo?
 
hey thanks for the info
actually i've setup cdn with my wordpress site by using W3 total cache and it's easy because there's an option there to choose Amazon CloudFront with a click of a button after I've setup my "origin pull"
So in this case after i've setup cloudfront pull how do I configure my xenforo?

Ok - so you created a domain pull account at Amazon Cloudfront.

The origin in your "Distribution" has to be your domain name your Xenforo is located (you can't specify folders yet)

*NOTE - creating CNAMES for your CDN is not essential. You can use your cloudfront domain name instead. It should still work ok (maybe some adblockers on some browsers wont like it??? Not sure) It will just look like you are pulling from cloudfront when someone views your page source eg e445rrt5wadw.cloudfront.net instead of your domain name. If you choose to do this, just skip the adding CNAME part and replace all references to CNAMEs below with your cloudfront domain name.**

Select the distribution and select edit.
Under cnames, I entered the following (you can create whatever names you want) :
cdn-js.mydomain.com
cdn-data.mydomain.com
cdn-img.mydomain.com

Then you have to go to your website hosting panel/dns zone editor and create those CNAMES.

The CNAME is cdn-js (Some web servers require the full cdn-js.yourdomain.com - best to check with your host or in your hosting panel) and the target address is the Domain Name in the AWS Dashboard (will look like e445rrt5wadw.cloudfront.net - some web hosting systems require a "." after the end of the target address so you may need to put that in. )

Do the same as above again and create the other two CNAMES cdn-data and cdn-img pointing to the same Domain Name as above (looks like e445rrt5wadw.cloudfront.net- get yours from your AWS Dashboard)

Now it's time to tell your Xenforo about the CDN and where to get the images from.

Edit /library/config.php

Add the following two lines (they aren't already there)

Code:
$config['externalDataUrl'] = 'http://cdn-data.yourdomain.com/forumfolder/data';
$config['javaScriptUrl'] = 'http://cdn-js.yourdomain.com/forumfolder/js';

NOTE - If your forum is in root, just remove the forumfolder part and leave it as 'http://cdn-data.yourdomain.com/data' 'http://cdn-js.yourdomain.com/js'

Save config.php and reupload it.

You can now test your site by visiting the page. If it's loading ok, you can check that its working by viewing Page Source. Look for references to the cdn names cdn-js and cdn-data - if you can them in the page source it means your files are being loaded from the CDN and we can move on to the next part which is adding your image CDN path.

Go to Xenforo Admin Control Panel. Styles -> Style Properties -> General. Look for path to images. Change this to http://cdn-img.yourdomain.com/forumfolder/styles/default (or whatever the path is to your styles folder you are using - if you are using the default then what i've given is correct)

Save that and confirm that images are loading on your forum. If yes, check the page source and look for references to cdn-img.yourdomain.com. If you can see that - congratulations! You're done.

This is all theory as I haven't actually used cloudfront. I use MaxCDN with Apache on my server and it works fine. They are both setup pretty similarly (except you can specify folder paths on MaxCDN) so I see no reason why it wouldn't work.

Cheers
Graham
 
Ive been playing with edgecast this arvo and that's working well too. Bit painful if you make a mistake in setup as it can take up to an hour for changes made in the backend to take effect.
Once it's up and running though it seems pretty good. Will be swapping over this weekend to see how it compares to MaxCDN.
 
MaxCDN is generally the preferred option.

I am currently using EdgeCast CDN.
Very impressed with their overall service.

MaxCDN is probably cheaper, but Edgecast (I signed up through gogrid) has a POP in Australia (where I'm located and most of my traffic comes from) so it makes sense to pay for a CDN with a local presence.
 
MaxCDN is probably cheaper, but Edgecast (I signed up through gogrid) has a POP in Australia (where I'm located and most of my traffic comes from) so it makes sense to pay for a CDN with a local presence.
Same story here - just checked my stats for Feb and 7.97GB out of 11.51GB were served from the Sydney Edge Node.
 
Bringing this one up again, does anyone have any experiences with CloudFlare for XenForo, phpBB and vBulletin 3.8.x? I'm running all these on the same server and it'd be way more convenient for me to go with a solution that wouldn't require me have to manually configure each and the other CF benefits might be of use as well.

Makes me wonder how CF could be equally effective as classic CDNs which require a ton of manual configuration - does it encompass all data a properly configured CDN would, for instance?
 
The good news is that we don't require any manual configuration, really (we cache static content by default & this is done by extension). If you switch your DNS to CloudFlare, then we take care of the caching and the like.

The main issue really has to do with making sure that the correct visitor IP is being returned in your logs (ours will show without a fix) & there are solutions for those platforms
 
The good news is that we don't require any manual configuration, really (we cache static content by default & this is done by extension). If you switch your DNS to CloudFlare, then we take care of the caching and the like.

The main issue really has to do with making sure that the correct visitor IP is being returned in your logs (ours will show without a fix) & there are solutions for those platforms

Yea, I realize that... is your support area login separate from the site accounts? Because it's not accepting either the site ID or the e-mail I signed up with so I can't respond to the query I put in (except via e-mail). Which is rather odd, since I didn't need to open another account when I contacted you. Why don't you tie support with the main accounts?

Also, a question... is there any particular reason why you don't cache archived files (zip, rar, etc.)? That's a rather big downside for me as I have a few websites where we have a lot of downloads/forum attachments and would definitely want to cache them.
 
"Yea, I realize that... is your support area login separate from the site accounts? Because it's not accepting either the site ID or the e-mail I signed up with so I can't respond to the query I put in (except via e-mail). Which is rather odd, since I didn't need to open another account when I contacted you. Why don't you tie support with the main accounts?"

This is an issue with our ticketing vendor. We're actually changing systems tonight, with any luck (the SSO doesn't always work for some reason now).

". is there any particular reason why you don't cache archived files (zip, rar, etc.)? That's a rather big downside for me as I have a few websites where we have a lot of downloads/forum attachments and would definitely want to cache them."
Not really what we are set up to do. You could theoretically create PageRules to do more advanced caching with other content types.
 
"Not really what we are set up to do."

^Can you clarify on that please? From your perspective, are downloads any different from content like images, for instance?

Via PageRules, if I wanted to cache archived files, I could set that up?
 
""Not really what we are set up to do.""

We are set up to cache static content by default. By default this means that things like downloads are not something we would cache by default.

"Via PageRules, if I wanted to cache archived files, I could set that up?"
Yes, it should work if you had something like...

yourdomain.com/downloads or downloads.yourdomain.com & you set a PageRule to cache everything.

Note: If the downloads are large, however, I would honestly recommend moving them to a subdomain we don't proxy. There is currently a 50mb limit in place for items that run through the proxy.
 
""Not really what we are set up to do.""

We are set up to cache static content by default. By default this means that things like downloads are not something we would cache by default.

Strange, I'd think downloads would fit the definition of static content.

"Via PageRules, if I wanted to cache archived files, I could set that up?"
Yes, it should work if you had something like...

yourdomain.com/downloads or downloads.yourdomain.com & you set a PageRule to cache everything.

Note: If the downloads are large, however, I would honestly recommend moving them to a subdomain we don't proxy. There is currently a 50mb limit in place for items that run through the proxy.

I see. Is this limit the same for all accounts, free & paid? And is this 50MB limit per item or 50MB altogether for a website?
 
Top Bottom