You may have heard that Google are obsessed with speed. You’d be right. They have a need, a need for speed! Since 2010 speed has been a major factor in their search algorithm. Speeding up websites is important, not just to site owners, but to all internet users. Faster sites create happy users and we’ve seen from our internal studies that when a site responds slowly, visitors spend less time there.

If you are a site owner, webmaster or author, here are some free tools you can use to evaluate the speed of your site:

Google PageSpeed Insights

– Analyzes your website speed performance and offers optimisation tips.

Here are some of the common optimisation tips we see:

Enable Gzip Compression

This is a method of compressing files before delivery, for faster network transfer. All modern web browsers understand the protocol, so it allows your web server to provide smaller file sizes which load faster for your website users. How to do it:
Add the following piece of code to your .htaccess file:


AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype

# For Olders Browsers Which Can’t Handle Compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

Minify Html, Javascript and Css

It’s recommended to put all your self hosted styles and scripts into a single file each, then minify them ( Strip out all spaces and replace long variable names with single letters ). If you have access to these source files, use a service like:

https://javascript-minifier.com/
https://cssminifier.com/

If you’re using wordpress it’s a little trickier, since these files are ‘enqueued’ into the header by the wordpress theme. But a good plugin like https://wordpress.org/plugins/w3-total-cache/ will take care of this for you.

You may have heard that Google are obsessed with speed. You’d be right.

Leverage Browser Caching

Adding an expiry date in the HTTP header for resources (Images, js, css) instructs the browser to load a previously downloaded version of the resource rather then over the network, adding speed to your page loads for returning visitors. This is another piece of code for your .htaccess file:


ExpiresActive on
ExpiresByType image/jpg “access plus 1 year”
ExpiresByType image/jpeg “access plus 1 year”
ExpiresByType image/gif “access plus 1 year”
ExpiresByType image/png “access plus 1 year”
ExpiresByType image/svg+xml “access plus 1 month”
ExpiresByType text/css “access plus 1 month”
ExpiresByType application/pdf “access plus 1 month”
ExpiresByType text/x-javascript “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 year”
ExpiresDefault “access plus 1 week”

Optimise Images

Large image files are a usual suspect for slow loading times on pages, in particular on mobile. So it’s worth knowing that Images can be optimised by an algorithm which drastically reduces their file size while maintaining the image quality. A favourite tool of mine is TinyPNG. Upload your images and see them reduced by 50-90% in size in some cases!

Leave a Reply

top