Blog Post

The Quest for Superfast Hosting

by: Simon Hughes
date: Saturday, Feb 2, 2019
category: my-technology hosting aws cloudfront

Up until Feb 2019, my website was hosted on a third party hosting platform. This was a typical hosting scenario where you have a small website you need to host without spending a fortune.

Hosting

You know the kind, the provider has a nice control panel where you manage your system and your website is hosted on a virtual server with hundreds of other sites. Most of the time this works just fine, but sometimes there are issues that require you to get more hands-on, and configure things exactly how you want, or maybe its not perfoming all the time.

Time to find a better solution that doesn't cost the earth.

Time to log into AWS, and see what we can do. One of my key prioirities here is no infrastructure, now I love to play with technology as much as the next person, but I don't have time to be building servers and keeping everything patched and up to date is a nightmare. Serverless is the right answer.

If you have read other blog pages, you will know this site is generated via a product called Hugo which is a template engine and creates nice clean html files for my site. The whole site is maintained in GIT and then deployed via Visual Studio Azure DevOps. This works really nicely, so needs to be compatible with everything else I have invested time into.

Hosting a static site on AWS S3 (Simple Storage System) is trivial. Create a nice bucket, set it to be accessible to the public, and tick the host a website here tickbox, and hey presto you have a URL that hosts your site. The big limitation of this is that it only works on http. Https is virtually mandatory these days, so I need a better solution.

Enter AWS CloudFront. CloudFront is the Amazon CDN (Content Delivery Network). It has thousands of servers at all the edge locations within the Amazon network, which means all your content gets cached as close to your end users as possible. This level of scalability could cost thousands, but on AWS, CloudFront costs less than a dollar a month for up to a million hits a month. It also has the ability to install an SSL certificate on. Hey presto, we have a fully scalable solution for this site for around 2 dollars a month.

Setup for CloudFront is pretty easy, we define a new distribution, enter the URL of our source website which is the S3 URL, and then configure up the real URLS for simonhughes.com and www.simonhughes.com, after that we need to generate and apply an SSL certificate and we are up and running.

According to my Google Analytics reports, every single page on this website returns in 0.00 seconds. Now thats what I want, I don't want you to be waiting around.

Do you want any more info on this, feel free to contact me, pick up the phone or drop me an email.

Related Blog Posts

Continuous Integration / Deployment

One of the key pieces of advice I give my clients is to automate as much as is reasonable. If you find any team member doing the same task a number of times then you should invest the time to automate it.

Read More

This Sites Technology

Today I thought it was worth writing a quick blog post to detail the technology I used to build this site, and why. Within the industry if you want a small site that's easy to update the default answer is WordPress. I do like to be different, and challenge the obvious to ensure the best results for my clients, so I pushed myself to find a better solution.

Read More