1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anyone use maxcdn?

Discussion in 'XenForo Questions and Support' started by Tempest, Aug 24, 2011.

  1. Tempest

    Tempest Active Member

    Has anyone here set up their xenForo forum to utilize maxcdn? I've had a go at it and so have my other staff members and we can't figure out why it's just not working. There's no integration plug-in for xenForo right now but it's a CDN, it shouldn't be hard to set up manually.

    Edit: Okay so I've got the CNAMEs and what not right. A friend tells me I need to edit each .css file and the urls in it for the styles. What's left me confused is I have no idea exactly what to edit. I haven't got a clue with these files.
  2. giorgino

    giorgino Well-Known Member

  3. Andy.N

    Andy.N Well-Known Member

    I use MaxCDN for our Wordpress front end but haven't found a way to use it for Xenforo yet.
  4. robdog

    robdog Well-Known Member

    I use MaxCDN with XenForo, at least as much as XenForo will allow me through the config file:
    $config['externalDataUrl'] = 'http://static.bolttalk.org/data';
    $config['javaScriptUrl'] = 'http://static.bolttalk.org/js';

    static.bolttalk.org will point to MaxCDN which points to bolttalk.com and grabs the corresponding file to save into their CDN and serves it from the CDN from that point on.
    el canadiano likes this.
  5. giorgino

    giorgino Well-Known Member

    thanks robdog, but it's too complicated for me :(
  6. Andy.N

    Andy.N Well-Known Member

    Yes, some tutorials for dummies would be nice ;)
  7. giorgino

    giorgino Well-Known Member

    really dummy :D
    bsedirectory likes this.
  8. robdog

    robdog Well-Known Member

    I am going to try and explain this the best I can, so here goes.

    Once you create your MaxCDN.com account, you will need to log in and create your first pull zone. A pull zone will receive a request from a user and check to see if it is already cached. If not, it will hit your server, grab the asset and then cache it on the CDN server for later requests.

    Go to Managed Zones -> Create Pull Zone.
    • Pull Zone Name: Whatever you want to identify you pull zone. For my site bolttalk, I used bolttalkstatic. The name is not really important so don't stress to much over this.
    • Origin Server: This is the BASE URL to your site. Again for bolttalk, I used http://bolttalk.com/. (include the http://; you can include the "www" in front if you want, I do not use the "www" for bolttalk)
    • Custom CDN Domain: Initially, I used cdn.bolttalk.com but I want to go with the cookie-less domain so I registered bolttalk.org and used static.bolttalk.org. You DO NOT have to register a separate domain, you can use cdn.YOUR_SITE.com.
    • Label: Again, this can be anything to help you identify the zone.
    • Compression: I would turn this on.
    Click "Create".

    Now go to the manage pull zones screen and you should see the zone that you just created. Click on that row or click on the "Manage" button to the right.

    The next screen will show you where to point your sub-domain/domain to enable the CDN. You should see a temporary URL: bolttalkstatic.freeprollc.netdna-cdn.com (this is mine for bolttalk)

    After you get that URL, you will need to create a CNAME on the domain that you are going to use. For bolttalk.com I had the bolttalk.org domain. I created a CNAME with a HOST value of "static" and a POINTS TO value of "bolttalkstatic.freeprollc.netdna-cdn.com". Save your domain setting or zone file.

    Adding the CNAME is probably going to be the trickiest part for a number of non-tech savvy people. But if you can figure that out, then you are GOOD TO GO!


    Basically get the URL of an image and type that into your browser:

    And modify it manually to point to your CDN:

    If the image work at BOTH urls, you can move on to the next step. Otherwise, recheck your settings or give it some more time to propagate. (propagation could take up to 48 hours depending on how you have your domain name setup with your host)

    Next, you need to edit the config.php file that is located in the library directory. Simple edit the config file and add the following 2 lines:

    $config['externalDataUrl'] = 'http://static.bolttalk.org/data';
    $config['javaScriptUrl'] = 'http://static.bolttalk.org/js';

    You will need to modify the above 2 lines to reference your OWN custom CDN URL, but you can see how I set it up for myself.

    Finally, you will need to modify a value in the style vars:
    Style Properties -> General -> Settings -> Path to Images:

    Again that is what I used, modify it to fit your needs.

    Post a reply if you have any questions.

    vanucci, Divvens, Smooth and 13 others like this.
  9. Fuhrmann

    Fuhrmann Well-Known Member

    Very nice. I'll favorite this post for future reference. Thanks!
  10. giorgino

    giorgino Well-Known Member

    Thank you rob dog, work perfectly! :)
    Only one thing: Remember to all that the path should include the forum directory.

    If your board is in /forum/ directory, remember to add /forum in cdn path
  11. Andy.N

    Andy.N Well-Known Member

    I follow your guide and got cdn setting and working. After a day of running, I check MAXCDN log and see that that /forum/js/xenforo/xenforo.js is indeed served from MAXCDN 800 times.

    But there isn't much else served from MaxCDN.
  12. giorgino

    giorgino Well-Known Member

    This is my top ten

    Schermata 10-2455860 alle 10.32.16.png
    Andy.N likes this.
  13. Andy.N

    Andy.N Well-Known Member

    For what it worth, I use the same MaxCDN to serve my Wordpress which may explain why the most popular files are mostly WP files and only the xenforo.js is shown there.
  14. robdog

    robdog Well-Known Member

    You can create a different pull zone for your XenForo files so you can have a better picture that is separate from your Wordpress files.
  15. Andy.N

    Andy.N Well-Known Member

    Got it working finally.
    I use a different domain for cookieless purpose now. ;)

    My forum has a score of 91/100 while my WP has a score of 67 with W3TC plugin.
    I'm trying to see how to set the expiration for my images (server running nginx)
  16. giorgino

    giorgino Well-Known Member

    I'm using nginx too... :)
  17. giorgino

    giorgino Well-Known Member

  18. robdog

    robdog Well-Known Member

  19. giorgino

    giorgino Well-Known Member

    Some malfunctions in js feature like move threads ecc...
    Commenting the two line above, all work good
  20. Andy.N

    Andy.N Well-Known Member

Share This Page