We’ve lately been working on speeding up the website, and if you’ve been with us for some time you’ve hopefully noticed the difference. Specifically, we’ve been working on reducing the page load time, which is the time it takes from when you request to see a page on our site until it is fully loaded in your browser.
This post is more technical than usual, but read on if you’re interested
Yahoo! provides an excellent resource with tips on how to improve website performance, highlighting the following actions:
- Minimize HTTP Requests
- Use a Content Delivery Network
- Avoid empty src or href
- Add an Expires or a Cache-Control Header
- Gzip Components
- Put StyleSheets at the Top
- Put Scripts at the Bottom
- Avoid CSS Expressions
- Make JavaScript and CSS External
- Reduce DNS Lookups
- Minify JavaScript and CSS
- Avoid Redirects
- Remove Duplicate Scripts
- Configure ETags
- Make AJAX Cacheable
- Use GET for AJAX Requests
- Reduce the Number of DOM Elements
- No 404s
- Reduce Cookie Size
- Use Cookie-Free Domains for Components
- Avoid Filters
- Do Not Scale Images in HTML
- Make favicon.ico Small and Cacheable
Most of these points are taken into account on sendinvoice.co.uk, as it is basic knowledge for any good web designer. However, until now, we have not been using a Content Delivery Network (CDN) to serve static content (images, CSS, javascript etc.).
A CDN is a group of geographically dispersed servers that allows you to serve content near the end-user. In practice, this means that if you access our site from Singapore or Boston, you don’t need cross continents to download static content from our servers in the UK – but we’ll serve it from a location near you.
Send Invoice has users in over 90 countries, so it is important for us to provide a good user experience also if you’re far away from our main servers in the UK.
The benefits of CDN are not only about geographical proximity, however, as serving content from multiple domains also allows for more concurrent downloads. That means that if you need to download 15-20 items (pictures, stylesheets etc.) to show a page, rather than downloading 2 items at the time, you can download, say, 8-10 items at the time.
There are numerous CDN providers, and we opted for Amazon’s CloudFront due to their excellent geographical coverage (currently 24 sites across US, Europe, Asia and LatAm), low latency and high speed. Also, it helps that we already use Amazon Web Services for to help deliver other aspects of Send Invoice.
Now, with this and a number of other smaller changes made to speed up the website, it is time to test the results. Pingdom provides a great tool for measuring the page load time from various locations, and the result is very encouraging:
