Part 2 – Optimise your website for speed

Categories:SEO, Tutorials

Tom Barber

Lets dive deeper

Try following some of these more advanced tips for speeding up your website. Remember to keep testing thoroughly using GTmetrix - However, also it’s really important to remember that achieving a 100% score is almost impossible without it having a detrimental effect on your website. Try to aim high, but be sensible.

Leverage browser caching

For the more advanced users, you can set a rule to specify how long your visitors browsers should cache your files. As you can see in the code below, you should set rules for images, CSS, Javascript & Flash. Just copy & paste the below code into your .htaccess file & set whatever dates you require.

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access 1 year"
  ExpiresByType image/jpeg "access 1 year"
  ExpiresByType image/gif "access 1 year"
  ExpiresByType image/png "access 1 year"
  ExpiresByType text/css "access 1 month"
  ExpiresByType application/pdf "access 1 month"
  ExpiresByType application/x-javascript "access 1 month"
  ExpiresByType application/javascript "access 1 month"
  ExpiresByType application/x-shockwave-flash "access 1 month"
  ExpiresByType image/x-icon "access 1 year"
  ExpiresDefault "access 2 days"


Although we aren’t sure if this word is in the dictionary yet, it is an essential element which will contribute to your website load-speed. It almost speaks for itself in that it minify’s your website HTML, CSS & JS into smaller files, sometimes even combining the files to prevent further requests & resources. You will see minification pop up a lot on the speed test tools we suggested previously, just follow their steps to minify the files they suggest. Alternatively, you can use this online tool to do the job for you.

Enable gzip compression

We have all compressed files using our operating system for many years, Gzip Compression works in a very similar way for your website content. It compresses the content to minimise the size of the data being transferred from server to browser, therefore bringing the load time down drastically.

To enable this essential feature, try copy & pasting the below code into your .htaccess file. You can then check if you have inserted correctly using this tool. If you wish to enable Gzip compression just add this piece of code to your .htaccess file:

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

Use a CDN

If you have never heard of a content delivery network (CDN) as briefly touched upon in our previous post, you should definitely consider it if your website gets a lot of traffic, especially if it gets consistent relevant traffic from multiple countries.

A CDN will keep a copy of your website on multiple servers dotted around the world, so when a visitor accesses your site it is loaded faster from the closest location. That & a CDN such as Cloudflare offers a vast array of benefits mainly to do with site security which are essential if you are running a fast-paced website. For more information on CDN’s & advice for which will best suit your requirements just get in touch.

This website uses cookies to ensure you get the best experience on our website. Read more in our privacy policy