10 Tips for Understanding and Improving Your CDN Strategy
November 24, 2015 | Robert Gibb
Every week we send a CDN tip to subscribers of our Weekly CDN Tip. These tips provide subscribers with ways to improve – and better understand – content delivery and web performance. This post is a compilation of our tips from the last few months.
Rarely do content delivery networks talk about the impact their service has on a business’s bottom line. We make your website faster! is the go-to slogan used by CDNs and remembered by their users. But we recently discovered that a CDN’s impact extends far beyond the confines of site speed (see Tip #1 and #2).
Something else that’s rarely talked about in the CDN space is bandwidth savings. Because CDNs primarily charge customers based on bandwidth usage, they’re hesitant to present methods for using less bandwidth. In Tip #4 and #5 we present ways to lower bandwidth usage and follow up with more ways to optimize your content delivery strategy.
Lastly, it’s good to know when your CDN is working (having a high cache hit percentage, for instance), but it’s better to know how it’s working. This allows you to troubleshoot your CDN configuration easier and optimize it faster. In tip #9 and #10 we offer a primer on understanding caching headers. We also show you an overlooked real-time insights tool located inside the MaxCDN Control Panel.
These 10 tips can be grouped into three categories of CDN best practices, namely measurement, optimization, and analyzation. To further understand and improve your content delivery strategy, put these into action today and repeat them in the future.
Measure Performance and Results
Tip #1: Wait 20 Days
New research shows that MaxCDN impacts traffic and search engine rankings 20 days after implementation.
After implementing MaxCDN, your website’s page load time improves instantly. But other improvements resulting from CDN implementation occur as well – they just take a little longer to kick in. A few of these longer term improvements include higher Google rankings and more unique pageviews.
One MaxCDN customer experienced a 433% spike in clickthroughs and 1495% spike in traffic 20 days after implementing MaxCDN. He attributed this delay to the time it took Google to recrawl his faster, CDN-powered website.
Related Blog Post: RebatesZone Increases Traffic by 1495% with MaxCDN
For this customer and many other businesses, more traffic means more conversions – which means more money. This customer in particular attributed a 60% increase in revenue to MaxCDN. Bottom line? After implementing MaxCDN, it literally pays to be patient.
Tip #2: Measure the Impact of Your CDN
Measure page load times and conversions with and without your CDN.
You’ve been told you need a CDN. But what impact is it really making? In a blog post we we tell you how to measure a CDN’s impact on page load times and conversions. Completing this test will allow you to:
- Understand if CDN costs are worth the performance benefits (page load time)
- Understand a CDN’s impact on your bottom line (conversions)
- Get featured in future research related to CDNs’ impact on conversions.
Just keep in mind that this test does not account for a CDN’s ability to handle traffic spikes and ensure uptime. To test a CDN’s impact on reliability, we recommend using one of the following tools: Load Impact, Loadster, or Neustar.
Optimize Content Delivery
Tip #3: Implement a CDN Failover Strategy
Ensure uptime, all the time, with a CDN failover strategy.
Amazon experienced some major cloud outages in September 2015, stoking fear of downtime within many companies. CDN failover strategies direct this fear of downtime by bringing a backup service into the content delivery equation.
While the outage did not affect Amazon’s CDN, outages with CDNs do occur. So if your success hinges on fast and reliable content delivery, you should strongly consider implementing a CDN failover strategy. To determine if you need a failover strategy, follow these steps:
- Listen to or read this blog post.
- Determine whether success hinges on having an “always-on” CDN.
- If so, determine if you want an active or passive failover strategy.
- Implement your failover strategy with the help of this PDF.
Tip #4 Use Open Source CDNs
Go open source to achieve better UX and faster content delivery at no extra cost.
At MaxCDN we host a variety of open source projects on our network.
Open source projects hosted on content delivery networks prove that some things in life can be fast, free, and freaking awesome.
Related Blog Post: Free Open Source CDNs (That You’ll Actually Use)
Tip #5: Optimize Images
Optimize images before CDN delivery to save bandwidth and further improve loading time.
In case you haven’t heard, web pages are officially obese. On average they weigh 2.1MB – double what they weighed in 2011 – and images account for 62% of these monstrosities. Not only are images making pages load slower, but they’re also hogging CDN bandwidth.
For instance, if you have a 300KB image that can be optimized to 30KB, that means you’re serving one person an image at the cost of ten. This can quickly add up to CDN bandwidth overages.
To avoid overages and improve web performance, try putting all images through ImageOptim (if you use a Mac). You can also use the image optimization tools listed in our high performance images blog post.
Tip #6: Reconfigure Your CDN After Origin Changes
To prevent redirects, reconfigure your CDN after enabling SSL, adding query strings, or making any other changes to your origin.
Sometimes at MaxCDN we see our customers make changes to their origin server without making the necessary changes to their CDN.
This often results in redirects to the origin for cacheable assets, meaning more cache misses and longer load times for users. As you can see in this scheme, two actions are faster than four – the number of actions caused by a redirect.
To prevent time-intensive redirects, review your CDN configuration any time after reconfiguring your origin server.
Related Blog Post: 5 Reasons and Fixes for CDN Slowdown
Tip #7: Encrypt CDN Assets for HTTP/2
Take advantage of SPDY and HTTP/2 by encrypting CDN assets with SSL.
To take advantage of faster content delivery and lower bandwidth usage that HTTP/2 promises, you’ll need to encrypt your CDN assets with TLS/SSL.
Related Blog Post: 3 Things CDN Users Need to Know About HTTP/2
By encrypting CDN assets, you’ll also be able to enable SPDY, another performance-based protocol. We offer a free version of SSL, as well as more custom paid versions.
Screenshot: You can encrypt assets in one click by going to Manage -> SSL in your pull zone dashboard.
Then again, according to this post by Nginx, you may not even want to enable HTTP/2. And depending on your audience and web service, you may not even need SSL. Some performance testing is needed to see what delivery method works best.
HTTP/2 Update: We’re in active development of HTTP/2. When we deliver HTTP/2 support, we want to ensure it not only fulfills the features that fit the spec but also compatibility for our customers’ global audiences (browser compatibility, origin server compatibility, etc). We’re also looking into other parts of HTTP/2 such as server push. If we released support now, it would be premature.
Tip #8: Enable OCSP Stapling
Enable OCSP Stapling to cut SSL connection times by up to 46%.
If you’re not securing assets with an SSL certificate, it’s something worth exploring. Only with such a certificate can you leverage web performance protocols like SPDY and HTTP/2 and gain more user trust.
In tip #7 you can see how easy it is to enable SSL and SPDY (for free) in the MaxCDN Control Panel. But your ability to tighten up security while improving web performance doesn’t stop there. A few months ago we released OCSP stapling, a method for making secure connections even faster. This allows you to cut SSL connection times by up to 46% and activating it is a simple process.
Tip #9: Learn Caching Headers
Learn how to read and understand caching headers to analyze and optimize your content delivery strategy.
Caching headers determine how your content is delivered and stored by your CDN. In this blog post we review caching headers used by CDNs and present some great tools for generating and inspecting HTTP responses that contain caching headers.
Here’s an example of a response for a request sent to this image on the MaxCDN homepage.
Accept-Ranges: bytes Access-Control-Allow-Origin: * Cache-Control: max-age=604800 Connection: keep-alive Content-Length: 15328 Content-Type: image/png Date: Tue, 24 Nov 2015 18:56:14 GMT Etag: "5653b8bb-3be0" Expires: Tue, 01 Dec 2015 18:56:14 GMT Last-Modified: Tue, 24 Nov 2015 01:09:15 GMT Server: NetDNA-cache/2.2 Vary: Accept-Encoding X-Cache: HIT X-Frame-Options: SAMEORIGIN X-Type: static/known
This response, generated using the Hurl.it tool, shows that the image was delivered by the CDN rather than our origin server (X-Cache: HIT, rather than MISS). It also shows that the image will live on the CDN for one week, or 604,800 seconds, before the CDN checks for an updated image on the origin (Cache-Control: max-age=604800).
As a first step in analyzing caching headers, send a request to a file of yours using the Hurl.it tool. What is the X-Cache? What is the max-age? Does it correspond to the caching rules you specified in your MaxCDN Control Panel?
Note: MaxCDN’s edge servers only cache a file after two requests are made. If there’s a cache MISS, request the file two more times. The third time, X-Cache should read HIT. If it doesn’t, your CDN isn’t properly configured.
Tip #10: Analyze CDN Traffic with Raw Logs
Use Raw Logs for better troubleshooting and content delivery insight.
Many MaxCDN users often overlook our powerful insights tool called Raw Logs.
This feature gives you granular, immediate insight into all CDN activity, letting you see every request that comes your way. It puts pre-parsed data right inside your MaxCDN Control Panel and lets you filter requests by zone, client location, cache status, user agent, CDN PoP, and much more.
Whether you need quick insight for troubleshooting or just need to satisfy your curiosity, Raw Logs is where it’s at.
Repeat the Process
By no means do these steps or tips have to be completed in the order presented in this post. In fact, some tips might not be relevant at all. Because every business’s approach to content delivery is different, each business will have a unique process and strategy.
The information in this post should, however, help you generate some ideas for how you can improve your existing (or non-existing) approach to measuring, optimizing, and analyzing CDN performance.
When you figure out what that approach is, make it a living, breathing process. With the fast output of new protocols, compression algorithms, troubleshooting tools, and other web technologies, you could easily find a way to make your content delivery strategy stronger than it was the day before.