SEO Tips - Text Compression With GZIP

GZIP is a generic compressor that can be applied to any stream of bytes: under the hood it remembers some of the previously seen content and attempts to find and replace duplicate data fragments in an efficient way - for the curious, great low-level explanation of GZIP. However, in practice, GZIP performs best on text-based content, often achieving compression rates of as high as 70-90% for larger files, whereas running GZIP on assets that are already compressed via alternative algorithms (e.g. most image formats) yields little to no improvement.

All modern browsers support and automatically negotiate GZIP compression for all HTTP requests: our job is to ensure that the server is properly configured to serve the compressed resource when requested by the client.

  • GZIP performs best on text-based assets: CSS, JavaScript, HTML
  • All modern browsers support GZIP compression and will automatically request it
  • Your server needs to be configured to enable GZIP compression
  • Some CDNs require special care to ensure that GZIP is enabled
Library Size Compressed size Compression ratio
jquery-1.11.0.js 276 KB                            82 KB 70%
jquery-1.11.0.min.js 94 KB                           33 KB 65%
angular-1.2.15.js 729 KB                          182 KB 75%
angular-1.2.15.min.js 101 KB                           37 KB 63%
bootstrap-3.1.1.css 118 KB                           18 KB 85%
bootstrap-3.1.1.min.css 98 KB                            17 KB 83%
foundation-5.css 186 KB                            22 KB 88%
foundation-5.min.css 146 KB 18 KB 88%

 

The above table illustrates the savings provided by GZIP compression for a few of the most popular JavaScript libraries and CSS frameworks. The savings range from 60 to 88%, and note that the combination of minified files (identified by “.min” in their filenames), plus GZIP, offers an even larger win.

  1. Apply content-specific optimizations first: CSS, JS, and HTML minifiers.
  2. Apply GZIP to compress the minified output.

The best part is that enabling GZIP is one of the simplest and highest payoff optimizations to implement - sadly, many people still forget to implement it. Most web servers will compress content on your behalf, and you just need to verify that the server is correctly configured to compress all the content types that would benefit from GZIP compression.

Ref: Text compression with GZIP

Posted On : 18-02-2016

Copyright © 2016 - All Rights Reserved

Designed by Find Solution