February 5 2019

Brotli vs Gzip compression. How we improved our latency by 37%

What does it mean to compress static resources like JS, CSS or HTML? How to do it best?

In today's world, the customer experience it is the most reliable and efficient strategy that can be developed to increase engagement, hence the business. In this post we will focus on giving customers something to experience as fast as possible, which is a fast page load.

According to a Google study, 40% of people abandon a website that takes more than 3 seconds to load and a 1 second delay in page response can result in a 7% reduction in conversions. Yes, every second matters! And we saved about 2,5 seconds (90th percentile) and 1,2 seconds (50th percentile) by using Brotli compression over gzip compression for our Javascript and CSS files.

What is Brotli?

Just like gzip, Brotli is also a compression algorithm. It is developed by Google and works best for text compression. The reason is that it uses a dictionary of common keywords and phrases on both the client and server sides and therefore offers a better compression ratio.

It is supported by all major browsers:

Does your browser support Brotli?

Browsers that support Brotli send "br" along with "gzip" in the header of the accepted encryption request. If Brotli is enabled on your web server, you will receive response in Brotli compressed format.

Gzip vs. Brotli:

The advantage of Brotli over gzip is that it uses a dictionary and therefore only needs to send keywords rather than complete keywords. Indicatively speaking therefore:

  • Javascript files compressed with Brotli are 14% smaller than gzip.
  • HTML files are 21% smaller than gzip.
  • CSS files are 17% smaller than gzip.

Note: Images should not be compressed by gzip or Brotli as they are already compressed and compressing them again will increase the size.

Fewer bytes transferred not only leads to faster page loading, but also helps reduce Content Delivery Network (CDN) costs.

Support from Hosting Providers?

Although Brotli is now a well-proven standard since 2017 with specifications already defined in the RFC 7932. it does not appear to have become a standard used on a large scale by most hosting providers.

If we want to give an order of magnitude and some numbers, let's say that indicatively at least 80% of websites do not use Brotli compression. 

Do you want because the main control panels (CPanel and Plesk) do not install Brotli by default, or because the Hosting vendors objectively do not care to provide something that the customer has not asked for and that instead would require a further additional system configuration by systems engineers without art or part.

The fact is that to date, once again, in addition to denying you important features such as Caching REDIS, Caching Varnish, Memcache, HTTP2, ALPN, and as more and more advanced functions, you have discovered that EVEN Brotli is something with HIGH ADDED VALUE in the true sense of the word. It is not there and must therefore be added.

The peracottari out there who have hosting agencies they don't care about your performances, after all, you don't even know what hosting is and how it should work.

With us, things are different.

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

INFORMATION

Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds holds the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV Hetzner Online GmbH owns the rights to Hetzner®; OVHcloud is a registered trademark of OVH Groupe SAS; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Facebook, Inc. owns the rights to Facebook®. This site is not affiliated, sponsored or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a trademark registered at European level by MANAGED SERVER SRL, Via Enzo Ferrari, 9, 62012 Civitanova Marche (MC), Italy.

Back to top