CDN Integration Tips for 4 Different Business Types
January 21, 2016 | Robert Gibb
This is the third post in a series that covers all 6 steps of the CDN Framework – a guide designed to help you acquire and maintain the best CDN solution possible.
By this point you should have done one of two things: 1) created a test account with your preferred CDN or 2) purchased a package with your preferred CDN. If you have not done either, start by requesting a free test account from a provider. This will help you avoid unnecessary charges in the event you aren’t satisfied with the service.
Here are links to where you can request a free test account from the CDN providers we compared in Step 2:
|CDN||Free Trial Type|
|Akamai||Contact sales to request free test account|
|AWS CloudFront||50 GB of traffic for free|
|CloudFlare||Free basic plan|
|Fastly||Test up to $50 of traffic for free|
|MaxCDN||100 GB test account|
|Verizon (formerly EdgeCast)||Contact sales to request free test account|
When you have access to a CDN account, the next step is to integrate it with your website or web service.
If you are switching from one CDN provider to another, you’ll want to work with the provider’s support team (even if your team has technical knowledge of CDNs). But if you’re setting up CDN for the first time and only delivering static content, you can easily integrate the CDN on your own.
Keep in mind: As we showed in the CDN comparison tables in Step 2, professional support isn’t always complimentary. Depending on the provider you choose, you may have to pay for integration assistance and future troubleshooting.
However, as discussed in Step 2, additional support costs may not be a deal-breaker if the CDN is the only CDN with the technical features you require. Like anything in life, it’s all about weighing the pros and cons.
CDN Integration Goes Like This…
For businesses without dynamic content, the integration process is quite simple. But for businesses with dynamic content – and for businesses switching CDN providers – the process can get a little more interesting. The basic approach remains the same, but some custom modifications are needed.
That basic integration process goes like this:
- Creating a zone on the CDN
- Activating the CDN by updating DNS for static assets
- Perform QA by checking static asset URLs
This approach works for the majority of websites. However, for businesses that are switching CDNs and generating dynamic content, there are often sub-steps and additional steps.
We’ll touch on some of these in the business scenarios below. But to avoid tiresome troubleshooting, we recommend you always work with the CDN’s support team when integrating your CDN – no matter what the cost. They understand the intricacies of content delivery.
For Businesses with Mostly Static Content
For static content, you’re just replacing your origin URLs with CDN URLs. You automate this process by making code changes, or by installing a plugin for your CMS to make these changes for you. These changes put global “CDN” prefixes in front of relative URLs for static assets.
For instance, the static file with the relative URL of /logo.png that was once delivered by your origin (yourwebsite.com/logo.png) will be delivered from your CDN after implementation (foo.bar.netdna-cdn.com/logo.png). With a few DNS changes, you can mask this long CDN URL with your original hostname (yourwebsite.com/logo.png) or with a different hostname (cdn.yourwebsite.com/logo.png). Though, it’s best practice to use a different hostname for static content.
One development team gives us an example of how to manually configure code to deliver static assets. Though, instead of manually configuring code like they did, you’ll find that plugins work best. For just about every popular CMS there are are battle-tested caching plugins for CDN integration. They were built by performance-obsessed developers and are incredibly effective and easy to configure.
Here are some trustworthy CDN integration plugins for popular CMS’s that you can use to update the relative URLs of your static assets:
|Joomla||CDN for Joomla|
|Magento||(Native support in CMS)|
|WordPress||W3 Total Cache|
|WordPress||WP Super Cache|
|WordPress||WP Fastest Cache|
For Businesses with Some Dynamic Content
If your website has dynamic content and needs to generate shopping cart pages, user account pages, or other pages unique to individual users, custom rules and modifications need to be implemented. This is for reasons of security and user experience.
For instance, you don’t want to cache private information on a third party server, and you don’t want someone else’s avatar showing up in your account bar on your favorite forum. Fortunately, not everyone in the world has the same face and interests.
To deliver a unique, secure, and fast experience on a website leveraging dynamic content, certain configurations need to be made. These configurations allow your CDN to empower the personalized nature of dynamic content – not disrupt it.
Hooman Beheshti, VP of Technology at Fastly, is a pro in making the distinction between dynamic content and uncacheable content. According to him, all dynamic content as we know it is not uncacheable. Dynamic content that doesn’t contain sensitive data, or what he calls event-driven content, can in fact be cached. It’s just a matter of determining how long the caching time should be.
According to Beheshti, content often considered dynamic like wiki pages, sports scores, comments, inventory levels, and stock prices can all be cached. And to cache this type of content, your CDN needs to have instant purging and a full API. Your CDN must also give you access to realtime logs and analytics. (You can see what top 6 CDNs have these features in our CDN comparison tables.)
If you want to deliver cacheable “dynamic” content with your CDN – or want to work around the complications of truly dynamic content – definitely get the help of your CDN’s support team.
For Businesses Switching CDN Providers
In Step 2 we learned that the top 6 CDNs have custom caching rules. These are advanced rules that let you specify how your content behaves on the provider’s network of edge servers. According to our EdgeRules page, custom caching rules let you block requests, create custom redirects, manipulate headers, and optimize the mobile experience.
It’s vital that you share any custom caching rules you have in place with your new CDN provider. This will give the support team and solution architect the information they need to mimic the setup on your original CDN.
In addition to sharing custom caching rules – forcing HTTPS, adding canonical headers, redirecting by country, etc. – you need to share other configuration settings as well. This includes caching time (TTL), SSL/TLS certificates, API usage, log storage – anything and everything that was manually configured on your original CDN.
Put every modification you need onto a checklist, double check that list, then share it with your new CDN provider. Confirm with your new provider that everything is doable, then have them make the necessary configurations inside your control panel. After these changes are made, perform a local QA. If the QA passes, make it official with the DNS swap.
NOTE: Some businesses load balance traffic between their original CDN and new CDN. This is done with various DNS load balancing services. The purpose? To see which CDN performs better in a live testing environment. This approach isn’t suitable for every business, but is common among companies pushing high bandwidth with their original CDN.
Related Blog Post: Comparison of 4 Load Balancing Services
For Businesses Integrating CDN for the First Time
As discussed in Step 1, you’re most likely trying to improve page load times and/or decrease the chance of downtime with your CDN. Often, implementing an out-of-the-box CDN solution will achieve this. No fancy configurations required. Just follow the basic 3-step integration process discussed above.
The only custom configuration you should make before changing the DNS for static assets is asset encryption. If you secure connections with a TLS/SSL certificate on your origin server, you’ll also have to apply a certificate to your CDN. If you don’t, your website users will experience mixed content problems.
But other than setting up encryption, and possibly some caching policies like TTL, you shouldn’t concern yourself too much with custom caching rules. After looking at your current website setup, your CDN’s support team may make recommendations for you. And, as you continue to learn more about your CDN and its capabilities, you’ll learn what optimizations are possible.
We’ll talk about some of these optimizations in Step 4, but starting out, focus on getting your CDN up and running and delivering static content. Don’t over-complicate things. (If you’re using WordPress or another popular CMS, check out the plugins above for easy CDN integration.)
CDN Integration Resources
If you’re integrating CDN for the first time, you’ll be making configurations you’ve never made before. For instance, you may be overriding the TTL set by your origin, delivering different content to different users, and putting many different caching policies in place.
Making CDN configurations on your own is great practice, so don’t worry if you come across errors along the way. These errors are often very easy to fix. People have made them before, and solutions to these errors are documented online, often in your provider’s support portal.
Related PDF: The CDN Troubleshooting Guide
Here are the support portals for the top 6 CDN providers:
|Akamai||The Akamai Community has real solutions to real problems experienced by real people.|
|AWS CLoudFront||CloudFront has a Developer Guide that directs common questions and issues.|
|CloudFlare||CloudFlare Support has informational and how-to articles on several topics.|
|Fastly||Fastly Documentation has guides, tutorials, an API reference, and more.|
|MaxCDN||MaxCDN One is a knowledge base that helps you configure and optimize your CDN.|
|Verizon (formerly EdgeCast)||Verizon doesn’t offer documentation at this time.|
If you have any questions about CDN integration, please leave a comment below. And if you’re using MaxCDN, definitely take advantage of our free 24/7 support and 1-on-1 integration call.