Improve page load times

This article first appeared in issue 232 of .net magazine – the world's best-selling magazine for web designers and developers.

Content delivery networks (CDNs), put simply, are collections of web servers that are distributed across multiple locations around the world in order to deliver content more efficiently to users. The goal of a CDN is to serve content to end-users with high availability and high performance. So what does this mean for us as developers – and why should you use a CDN for your files?

Whenever a user makes a request to your website that is hosted in, say, New York, while they are based in London, the internet tubes must connect from the user’s location in London to the datacentre in New York. This means that your users will need to make a round trip across the world in order to retrieve a file from the server. Imagine not having to make such a journey to fetch these files – this is where a content delivery network comes in. Since static files such as images, JavaScript and CSS don’t change very often, there is no reason that they can’t be served to the user by another server that is geographically closer to them. It’s a shorter distance to travel, and this means quicker response times.

The benefits of using a CDN extend far beyond just brilliant response times; using a CDN additionally reduces the amount of bandwidth and requests that are served from your website. You get all the benefits of caching, Gzipping and a wider network that reduces the amount of bandwidth that is consumed by your website. A CDN also increases the number of files that a browser can download in parallel. Most browsers only allow you to download three or four files at a time from one domain. Using a CDN will enable the user’s browser to download more files in parallel, increasing their response times.

OK, so the benefits are apparent, but are large companies the only parties that can afford to use a content delivery network? The answer’s no – CDN technology is commercially available to all developers and it is highly affordable. You’ll pay only for the file storage space and outgoing bandwidth that you actually use. I use a CDN for my personal blog that receives a few thousand hits a month – and I only pay 30p a month.

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

The Creative Bloq team is made up of a group of design fans, and has changed and evolved since Creative Bloq began back in 2012. The current website team consists of eight full-time members of staff: Editor Georgia Coggan, Deputy Editor Rosie Hilder, Ecommerce Editor Beren Neale, Senior News Editor Daniel Piper, Editor, Digital Art and 3D Ian Dean, Tech Reviews Editor Erlingur Einarsson and Ecommerce Writer Beth Nicholls and Staff Writer Natalie Fear, as well as a roster of freelancers from around the world. The 3D World and ImagineFX magazine teams also pitch in, ensuring that content from 3D World and ImagineFX is represented on Creative Bloq.