CDN

Discussion in 'XenForo Pre-Sales Questions' started by Jafo, Jul 29, 2010.

  1. Albert Member

    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?
  2. graham_w Active Member

    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
    Albert, Dinh Thanh and lazer like this.
  3. Dinh Thanh Well-Known Member

    The easiest way is using Cloudflare. Enable the domain with Cloudflare and let them do the rest.
    It's good for small sites.
  4. damoncloudflare Active Member

    Hi Dinh,

    Thanks:) We're actually pretty good with larger sites as well.
    Dinh Thanh and Fuhrmann like this.
  5. graham_w Active Member

    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.
  6. lazer Well-Known Member

    How does the pricing compare to MaxCDN?
  7. graham_w Active Member

    I went with a local reseller. There are plenty around. You just need to find the one that suits you. Edgecast require a high minimum spend per month to go direct with them.
  8. Albert Member

    I'm using cloudfront and it works!
    thank you for the detailed instructions
  9. IcEWoLF New Member

    MaxCDN is generally the preferred option.

    I am currently using EdgeCast CDN.
    Very impressed with their overall service.
  10. graham_w Active Member

    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.
  11. Moses Well-Known Member

    Same story here - just checked my stats for Feb and 7.97GB out of 11.51GB were served from the Sydney Edge Node.
  12. damoncloudflare Active Member

    Not sure which company you were asking about in the post. CloudFlare's service is free.
  13. lazer Well-Known Member

    Nope, Edgecast.

Share This Page