CDN (Content Delivery Network) and the Need for Speed
So, I host my blog and other websites with Hosting Matters, the folks have been great to me over the past decade and prices I have locked in are absolutely phenomenal (seriously – they are great). As with anyone who is on a shared hosting plan, network and server resources are divided across anyone else that is assigned that device, so response times sometimes get out of whack. I figured I’d try a Content Delivery Network to try to speed things up by offloading static content to the CDN.
I played around with WordPress’ Jetpack Photon CDN service, which completely fails for a photoblog – images are cached forever with no way to clear the cache other than to rename your images. Typically, with a typical blog this may be fine – but the image permalinks are important to me… so that solution was kicked to the curb. I also tried a couple of others, each had their good points, but failed miserably for other reasons.
And the (current) winner is …
This lead me to try out Incapsula‘s free CDN services. I set them up on this domain last night in about 5m, made the changes to my DNS records and about 20% of my traffic is now being served through the CDN. Moving the static bits up to a CDN for delivery seems to have greatly improved my response and load times – although I still have a number of tweaks to do with my .htaccess file’s HTTP Header cache controls to fine tune things. For example, my images rarely change so I can set the HTTP header to expire on JPG and GIF files every month (currently 1 week).
This also explains the small floating icon on the bottom right of all my pages. As I am using the free plan, they insert a small advertising graphic to the site. I wasn’t sure I was going to be ok with it, but it is small, out of the way, and mostly unobtrusive. Until I decide to upgrade to a paid plan, it is what it is. As the free plan is pretty much all that I need for a personal photoblog, I don’t see a reason to upgrade to be honest – other than to remove that web ad.
As I am leaving for New Zealand today, if anything goes awry, I’ll fix it when I get to my hotel and pump coffee into me intravenously. The fact is that the CDN has been running live now for 24 hours without a problem, and I don’t expect anything to implode.
While I am not yet ready to endorse the product, I will say it was easy to configure, worked out of the box, and has already stopped 15 attempted attacks on the blog … and the price is right (free).
As I moved this site over to Amazon Lightsail, I was able to start using SSL/TLS certificates created by Lets Encrypt and that caused me to drop the CDN entirely. This was purely a cost issue, as I have not (yet) found a reasonable priced CDN/Proxy that supports TLS. As a personal/hobby site, I simply cannot justify the costs of using TLS via a CDN. Ulitmately it came down to; do I want to support a secure platform, or do I want to support a CDN for my site. As a security professional, there really was no choice.