Speed up your site with a CDN

Speed up your site with a CDN 2015-07-18

No permission to download
Attachment thumbnails, yes (they are stored within /data/) Full attachments, no. Doing so would negate any permissions you have set on attachments.

Kind of sucks you can't use the CDN for attachments. Arguably this could be the largest problem area with a lot of forums.
 
I couldn't tell if it just worked with Amazon or also with other CDNS like MaxCdn.
I store my attachments in Amazon S3 and serve it trough Cloudfront.
For all other /data stuff I use MaxCDN. It's been working perfect for years. (y) :cool:
 
Most CDN's are very expensive to run aren't they? Have been watching this and am always interested but truthfully;
1, I'm not entirely sure where to start
2, do they really offer significant improvement on performance and can they be used for images?
3, costs? What kind of costs are involved with a CDN

Noobish perhaps, but never gone down this road with XF. Have with WP and other things, but on a completely different level.. :oops::confused:
 
Is possible / correct / reccomended set up internalDataPath externally? like:
Code:
$config['internalDataPath'] = 'https://my-cdn.xxx/data' ;
?
Actually I have this on my config:
Code:
$config['externalDataUrl'] = 'https://my-cdn.xxx/data';
and the thumbnails load from the CDN (pull zone) but when you open the thumbnail on the lightbox the images load from the internal directory.

According with: https://xenforo.com/help/config-php-options/
[...]
$config['internalDataPath'] - default: 'internal_data'
File path to the internal_data/ directory. Relative paths start at the XenForo installation directory. This can be set outside the web root.
$config['externalDataPath'] - default: 'data'
File path to the data/ directory. Relative paths start at the XenForo installation directory. This directory must be web accessible.
[...]

So, that's possible? recommended?
 
Gave MaxCDN a try for 30 days, was fine for the first week but after their services were slower, and the site/images were loading slower than they would from my own server. It also felt that MaxCDN wasn't caching the images, since every new page load would feel like the images (avatars, or whatever was being pulled from static) was being loaded once again.

Got rid of CDN yesterday and after 24 hours of monitoring, my site loads faster and the server load is actually more stable after removing CDN. Ofc, I also had @MattW optimize my server, maybe that's why serving static content from my own server is feeling faster now, but over the period of 30 days I don't think I saw any benefit of using a CDN, at least not MaxCDN for their price.

I guess I'll revisit this CDN approach once my board grows even more, currently receive anywhere between 14 to 20k visits per day, will probably give it a try when we reach 50/60k a day.
 
Thanks for this tutorial, @Mouth. I've tried CloudFlare, CloudFront, and MaxCDN in the past. Now trying KeyCDN. Hard to say whether it's making my sites faster. Without a doubt it's helping my scores (the one shown below is from the one site I have that doesn't show ads).

GT-FF.webp
 
Most CDN's are very expensive to run aren't they?
It's a little confusing, but maybe this well help. We started out with the basic 100GB plan See this page. Each month they charge you 9.00 and add 100GB so it is like a cell phone with rollover minutes. Make sure you turn on caching and it will save you as well! We host sites, and have like 10 different sites using the 100GB and don't use it all and we have 1.1TB built up now.

Really it's all about how much data you are transferring.

Under settings we have use GZip checked, and also set default cache time is set to 7 days on ours.
 
Last edited by a moderator:
Hi, I've just switch from cloudflare to using KeyCDN and Let's Encrypt, however I created the certificate on my own and then uploaded the keys and certificates for the custom SSL option.

I'm having an issue where things like the background and header image aren't loading on my website, I've made a CNAME for cdn.[mywebsite].com for the zone aliases and for my library/config.php is set to 'https://cdn.[mywebsite].com/data' and same for /js.

My xenforo general style settings for the path to images is "https://cdn.[mywebsite].com/styles/uix" and when I use the developer panel on chrome I'm getting a bunch of "Failed to load resource" and all the resources start with https://cdn.[mywebsite].com/

Any idea what I'm doing wrong?
 
I gave this a try but as soon as I updated my style setting all images on my site vanished. I followed the instructions but then backed out..
 
I gave this a try but as soon as I updated my style setting all images on my site vanished. I followed the instructions but then backed out..
Appears you configured something wrong.
If you want to step through it and show/describe you're settings, can probably help you identify the issue.
 
Appears you configured something wrong.
If you want to step through it and show/describe you're settings, can probably help you identify the issue.
Hi, after more investigating I can see (logging into my KeyCDN ftp account) that no data exists for my pull zone, the directory is empty. Isn't this supposed to auto populate with your data? As far as I can see I set my pull zone up correctly.
Screen Shot 2016-02-21 at 3.02.43 PM.webp

is Origin URL
my board url or web url root? should it be www.mysite.com/forum ?

Any ideas? Thanks
 
Top Bottom