Anyone use maxcdn?

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.
 
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.
thanks robdog, but it's too complicated for me :(
 
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!

TEST YOUR CDN SETTINGS BEFORE EDITNG YOUR CONFIG.PHP OR STYLE PROPERTIES!

Basically get the URL of an image and type that into your browser:
http://bolttalk.com/data/attachments/2/2528-e718dc8a2755f32242f2c3b22feb6c60.jpg

And modify it manually to point to your CDN:
http://static.bolttalk.org/data/attachments/2/2528-e718dc8a2755f32242f2c3b22feb6c60.jpg

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:
http://static.bolttalk.org/styles/bolttalk

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

Post a reply if you have any questions.

GOOD LUCK!
 
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
 
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';
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.
 
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.
 
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.

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.
 
Top Bottom