Amazon Cloudfront – benefits and uses

Amazon Cloudfront is a content delivery network by amazon. Commonly it’s thought that a cdn is supposed to dramatically increase the speed of your site, however that’s not always true. It’s bit more complicated than that and I’ll try to explain how and why.

Amazon cloudfront usage is very common with various types of websites, especially WordPress sites through caching plugins like w3 total cache and wp super cache. It not only helps in speeding up your site but also affects page speed and seo of your site. But remember that incorrect settings can in fact worsen your pagespeed score and reduce your serp too.

Amazon cloudfront is one of the cheapest cdn available. You pay a very nominal monthly price, usually less than a dollar, yes you heard it right!

What are the benefits of CDN like cloudfront

The main purpose of CDN like amazon cloudfront is to provide:

  • Caching
  • Scalability
  • Speed

Plus a few more.

Let me explain them and how they differ.


Caching with Amazon Cloudfront

Amazon cloudfront provides caching of your content. What does it mean? Well it means that your content is saved on their server and is served from there. Quite obvious right? Now how does it affect your website? Here it is:

  • Once that image, js, font, css or any other file is called, it goes from amazon server not yours, reducing load on your server
  • This also means that when you make any changes to your file on your server, they won’t be reflected, at least normally
    • There are settings that can be done to reflect the new changes though

Scalability with Amazon cloudfront

Cloudfront doesn’t provide speed only, it provides scalability. In fact making the site scalable is the main purpose of cdn rather than just achieving speed for a single page load.

  • The content loads from two sources simultaneously, your own domain and amazon cloudfront, making it fast, like few files are downloaded from your server and few from amazon
  • The website loads from the server near the visitor, making it faster for him too, but again reducing load on your server
  • Reducing load on your site when many users visit at once.

Let me explain it by an example.

Imagine that your server can deliver 100 files at a time. Also imagine that your page has 10 files in it.

Now when someone visits your site, every visit loads 10 files, which means only 10 users can be entertained at once on your site (making 100 files), without increasing the load time probably. It means, optimizing your site for a single page load isn’t enough. You have to optimize it for traffic, that when there is peak time and many users are active on your site, then will it still work fine or not.

Now if you’re using a Content delivery network like amazon cloudfront, it might not directly affect your single visitor page load time, but it will definitely help in improving the load time when many visitors are on your site at once. How? well like this:

When a visitor comes to your same site as above, he loads 10 files, say for example 5 from your server and five cached on amazon cloudfront server. Now this means that your server can’t handle 10 simultaneous visitors only, it can handle 20 visitors now (20 x 5 = 100), without showing lag in website loading.

So when cloudfront is configured, don’t just assume that as it’s not improving your single page load time, it’s useless, no it’s not! amazon cloudfront or any other cdn is definitely useful, especially for high traffic websites.

Speed with Amazon cloudfront

As I mentioned above, cloudfront isn’t supposed to be considered or judged based on load time for single visit. Although it might help in improving load speed if your server is extremely slow, by loading the files from relatively faster servers.

It’s still important to note that amazon’s servers aren’t the best or fastest, however they’re quite economical. Sometimes you might see a mild increase in load time of your site too with amazon cloudfront, however you’ll have to decide if you need it for peak traffic times or not.

Amazon cloudfront settings depend on servers, website code and requirements, visitors, etc. a lot. There is no one fits all setting that will just work for any website out there and it has to be optimized accordingly, especially if being used with any other caching plugins like w3 total cache or wp supers cache on WordPress.

Cloudflare and Amazon cloudfront

Yes both the services can be used together, however incorrect configuration that not only confuse you but also affect your website badly.

Cloudflare and amazon cloudfront, both have their own areas of specialty where they can enhance the performance and security of your website.

Configuring Amazon Cloudfront Service

I can configure Cloudfront for your WordPress site and non-WordPress ones too, with or without w3 total cache or other caching plugins.

Let me know if you have any custom requirement too.

Leave a Reply

Your email address will not be published. Required fields are marked *