Improving Google SEO – 4 simple steps

A very useful tool called PageSpeed by Google can be used to check the score of your web page based on a number of factors. This score affects the SEO of pages quite significantly. I'll outline the steps taken to improve the score for one of our sites from 29 to 82.

Step 1 – Minify .js and .css files

CSS minification: https://www.tutorialspoint.com/online_css_minifier.htm
JS minification: https://www.tutorialspoint.com/online_javascript_minifier.htm

Step 2 – Optimise images

Simply reduce the file size and quality of saved images. What size is ideal? Generally I'd recommend 100Kb per image.

Step 3: Add Gzip compression

This step essentially instructs the website to server defined file types using gzip compression which almost all modern web browsers support. This was the single biggest increase in the score obtained on Google PageSpeed. All we did was add the following lines at the bottom of the .htaccess file in the root web directory (or the directory from which your website is being served):

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

Step 4: Add Cache control

Browsers and search engines have the ability (as they should) to cache files which makes page load speeds faster as result of either loading locally or directly from Google's cache. This article explains the whole process of cache control very well. We didn't bother going into too much detail specifying which files should be cached. We simply said cache everything, which does have downsides as explained in the article. All we added to .htaccess was the following:

Header set Cache-Control "max-age=2628000, public"

This essentially says that all files should cached for 1 month.