You may have noticed in Google’s PageSpeed Insights that some websites are flagged up for not enabling compression.
What exactly is Gzip Compression
The simple’s way to explain Gzip compression is by imagining you ordered a new dinner table. Once it arrives it will be packaged with multiple parts that you will need to put all the pieces together to build the table.
Gzip compression works in a similar way but with computer bytes, the server will compress streams of bytes such as spacing within HTML, CSS or JS files and send them across the web.
Once the files are downloaded by your browser, the browser will start uncompressing these files. This simple feature can yield significant page speed improvements and reduction to page size.
This simple feature can yield significant page speed improvements and reduction to page size which can help improve SEO performance.
Enabling Gzip Compression with .htaccess
The code below should be inserted into your .htaccess file that usually lives in the root of your website.
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
Hosted with Koerge?
If your website is hosted with Koerge you won’t need to do anything. Gzip compression is enabled by default for all our customers, therefore no technical knowledge or changes are required to enable this feature.