Gzip Compression Wix

Posted onby

Enable text compression

If the file doesn’t exist, or the client does not support gzip, NGINX sends the uncompressed version of the file. Note that the gzipstatic directive does not enable on-the-fly compression. It merely uses a file compressed beforehand by any compression tool. To compress content (and not only static content) at runtime, use the gzip. Defining GZIP Compression GZIP’s purpose is the compression of files. It’s a server-side product that reduces the size of JavaScript files, stylesheets and HTML. Some WordPress users have reported a. With some compression methods the last byte or code can be interpreted as more data if you try to read more data than was present when compressing, due to leftover bits, but I'm not sure this holds for gzip. Wix gets really specific with its template categories, like Pets & Animals or Services & Maintenance. If none of the templates fit your vision, you have the option to start from a completely blank template and build exactly what you want from scratch.And when I say exactly what you want, I mean it – many builders will make you place elements according to a set grid, but in the Wix.

Text-based resources should be served with compression to minimize total network bytes. The Opportunities section of your Lighthouse report lists all text-based resources that aren't compressed:

How Lighthouse handles text compression #

Lighthouse gathers all responses that:

  • Have text-based resource types.
  • Do not include a content-encoding header set to br, gzip, or deflate.

Lighthouse then compresses each of these with GZIP to compute the potential savings.

If the original size of a response is less than 1.4KiB, or if the potential compression savings is less than 10% of the original size, then Lighthouse does not flag that response in the results.

The potential savings that Lighthouse lists are the potential savings when the response is encoded with GZIP. If Brotli is used, even more savings are possible.

How to enable text compression on your server #

Enable text compression on the server(s) that served these responses in order to pass this audit.

When a browser requests a resource, it will use the Accept-Encoding HTTP request header to indicate what compression algorithms it supports.

If the browser supports Brotli (br) you should use Brotli because it can reduce the file size of the resources more than the other compression algorithms. Search for how to enable Brotli compression in <X>, where <X> is the name of your server. As of June 2020 Brotli is supported in all major browsers except Internet Explorer, desktop Safari, and Safari on iOS. See Browser compatibility for updates.

Use GZIP as a fallback to Brotli. GZIP is supported in all major browsers, but is less efficient than Brotli. See Server Configs for examples.

Your server should return the Content-Encoding HTTP response header to indicate what compression algorithm it used.

Check if a response was compressed in Chrome DevTools #

To check if a server compressed a response:

  1. Press Control+Shift+J (or Command+Option+J on Mac) to open DevTools.
  2. Click the Network tab.
  3. Click the request that caused the response you're interested in.
  4. Click the Headers tab.
  5. Check the content-encoding header in the Response Headers section.

To compare the compressed and de-compressed sizes of a response:

  1. Press Control+Shift+J (or Command+Option+J on Mac) to open DevTools.
  2. Click the Network tab.
  3. Enable large request rows. See Use large request rows.
  4. Look at the Size column for the response you're interested in. The top value is the compressed size. The bottom value is the de-compressed size.

See also Minify and compress network payloads.

Stack-specific guidance #

Joomla #

Enable the Gzip Page Compression setting (System >Global configuration >Server).

WordPress #

Enable text compression in your web server configuration.

Resources #

Last updated: Improve article

Gzip Compression Test

1Installation
4Check http headers

The vast majority of websites today use some kind ofcompression, delivering their content, as most modern browserssupport compression. Compression is useful when applied to text(html, javascript, js), as images (usually png) are alreadycompressed. The result of compression is remarkable bandwidthsaving, so the site becomes more responsive. This is also a SEOadvantage.

Compression will slightly increase CPU usage, but in most casesthis is not a problem, comparing to compression advantages.

The most common compression solution is gzip compression. Almost allweb servers support gzip compression. Nginx has built-in httpcompression. This is probably a reason why Nginx rapidly gainspopularity.

Here I describe how to setup and test gzip compression in aDebian system with Apache using Apache module mod_deflate. Mod_deflate is the Apache2 successor ofApache v1.* mod_gzip. For other popular web servers you can findinformation here: IIS, Nginx.

Installation

In latest Debian version (Debian 6 or Squeeze),mod_deflate is installed and enabled. If not:

Edit website configutation file, for example:

add the following lines:

Explanation of above Apache directives:

  • Line 1: Enable gzip compression
  • Line 2: Do not compress images
  • Line 3: Do not compress already compressed files
  • Line 4: Do not compress pdf
  • Line 6-8: Some exceptions for old browsers

That’s all. Don’t forget to restart Apache.

As an alternative, you can use an .htaccess file inyour webroot directory (with the same Apache directives).

Gzip compression using PHP

If your site is PHP based, there is an alternative (notrecommended) method to apply gzip compression. Just makethe following changes to php.ini, save and restartApache:

Check gzip compression using mod_deflate logs

In order mod_deflate to keep logs, add the followinglines to website configuration file (and restart Apache).

To check mod_deflate log file:

Example

Comments on above log file entries:

  • Line 1: http://www.pontikis.net (compressed html document 4468bytes, original 18229 bytes, compression ratio of 24%)
  • Line 2: relevant log for layout.css
  • Line 3: relevant log for jquery.js
  • Line 4: relevant log for http://www.pontikis.net/blog/
  • Line 5: image (people.png) was not compressed
  • Line 6: relevant log forhttp://www.pontikis.net/labs/jui_datagrid/demo/
  • Line 7: relevant log for http://www.pontikis.net/feed/ (xmldocument)
Wix

You probably need to remove logging in a production server,after you check compression results.

Check gzip compression with online tools

Suggested tools:

  • GIDzip test http://www.gidnetwork.com/tools/gzip-test.php
  • DNSqueries.com test http://www.dnsqueries.com/en/check_http_gzip.php
  • HTTP Compression Test http://www.whatsmyip.org/http-compression-test/

Check http headers

Gzip compression can be detected from http headers, looking forContent-Encoding: gzip. In this example, the pagehttp://www.pontikis.net/blog/ is examined:

Chrome developer tools

Go to http://www.pontikis.net/blog/, press CTRL+SHIFT+I (orMenu button → Tools → Developer tools) and go to Network tab

Firebug (Firefox)

Go to http://www.pontikis.net/blog/, press F12 to activateFirebug and go to Net tab

Redbot.org

Using the online tool Redbot.org

Gzip Compression Ratio For Text

We appreciate your feedback and suggestions. Leave us a commentbelow.

Entrepreneur Full-stack developer Founder of MediSign Ltd. I have over 15 years of professional experience designing and developing web applications. I am also very experienced in managing (web) projects.

Gzip Compression Checker

Your comments are welcome!