Which is better deflate or gzip




















These challenges are:. In this post, part of our Lose the Wait performance series, I will discuss each of these issues and demonstrate how to configure your web server to implement HTTP compression properly. What should HTTP compression get applied to? The answer is simple: Any content which is not already natively compressed. Unfortunately, most people seem to focus on these 3 types of files. In fact, a quick web search shows that most of the top results for ".

Here is a list of common text resource types on the web which should be served with HTTP compression:. What do I mean by this? ICO files are an image format used originally used for icon images on Windows. The format, as it is in use today, was created over 20 years ago for Windows 3. Today, ICO files are used on the web as Favicons for a website, usually displayed in the address bar or browser tab. While modern browsers allow other file formats besides ICO support is not universal.

Many sites continue to use ICO files as Favicons for compatibility reasons. Despite being an image, ICO files are not natively compressed. SVG images are example of an image format which is not natively compressed. You might be using SVG images on your website and not even know it.

Divya Manian has written a comprehensive post about the pros and cons of SVG fonts. For the purposes of this discussion the main take-away from her post is that, until iOS 5, SVG fonts were the only type of custom font supported by iPhone, iPad, and iPod Touch. Font support is, to put it nicely, a giant mess. Font libraries abstract this away from the web developer and serve the correct format, including SVG fonts, to the correct browser.

This mean your website can be using SVG without you even knowing it. Another mistake developers make with HTTP compression is using it on content that is already natively compressed. In fact, it can hurt performance to two ways. First, HTTP compression has a cost. The web server has to take the content, compress it, and then send it to the client.

If the content cannot be compressed further, you are just wasting CPU doing a meaningless task. In fact, the overhead of adding headers, compression dictionaries, and checksums to response body actually makes it bigger, as shown in the figure below:.

Do websites actually do this? Fox News is the 40th most visited website in the United States. Zoompf actually has two different checks for this issue. Both of these problems usually are the result of a configuration problem with the web server or an inline network device. Something in your environment is applying HTTP compression to all outbound content instead of only content that should be compressed.

So far, we have talked about HTTP compression as if it is an opaque or atomic feature. But that is not the case. HTTP simply defines a mechanism for a web client and web server to agree a compression scheme can be used to transmit content. This is accomplished using the Accept-Encoding and Content-Encoding headers. There are numerous open source implementations of the algorithm. The standard implementation library most people use is zlib.

The zlib library also provides a data format, confusingly named zlib, which wraps DEFLATE compressed data with a header and a checksum. As Mark Adler , one of the authors of zlib, explains in this StackOver thread :. However early Microsoft servers would incorrectly deliver raw deflate for "Deflate" i. This caused problems, browsers had to try it both ways, and in the end it was simply more reliable to only use GZIP.

Verve Studios put together a test suite and tested a huge number of browsers. The results are not good. Safari 5. No problem. Complete failure.

Inconsistent and broken. Since you are going to have to configure your web server to use GZIP anyway, you might as well avoid the whole mess with Content-Encoding: deflate.

Nginx , like Apache, does not support deflate at all. It will only send GZIP compressed responses. Sending an Accept-Encoding: deflate request header will result in an uncompressed response. But remember — compression is more than just smaller file sizes — it also matters how long it takes to perform the compression AKA the compression speed. GZIP was faster at some levels, while Brotli performed faster at some levels.

OpenCPU also ran their own benchmarks and found that:. Akamai also notes that, if you play around with the Brotli settings, you can get compression speeds that rival GZIP while also benefiting from a better compression ratio.

Again, that includes WP Rocket. While almost every single host supports GZIP out of the box, finding a WordPress host that supports Brotli on shared or managed plans is much less common. WP Rocket also has a dedicated Cloudflare integration that makes it super easy to get up and running. GZIP is the older and more popular of the two, while Brotli is newer but picking up steam. Either way, remember that text compression helps improve the Largest Contentful Paint and the First Input Delay metrics.

Colin Newcomer is a freelance writer who spends his days inside the WordPress dashboard. He lives a life of danger, riding a scooter through the chaos of Hanoi. Thank you for sharing this informative article. I wonder if that conflicts with WP Rocket or not? As the plugin has already gzip enabled! Page speed optimization for WordPress is not as difficult as it seems: if you follow the steps mentioned in this guide, you can achieve the best load time.

For the gzip-enabled versions, we used the default settings for both Nginx and the gzip command-line application. To run the test, we used a recurring page speed check to contact the site every 30 minutes. After four runs, we reconfigured and restarted the Nginx server for the next test. We dropped the first run to allow time for the Nginx server to warm up. We verified that Nginx was using static compression and not dynamic compression by using strace to see which files were being accessed:.

With dynamic compression, the web server transferred For some files, such as bootstrap. Although this was a small site with few optimizations, simply enabling gzip on the web server allowed for a significant savings in load time. The fact that static compression performed roughly the same as dynamic compression also shows that for smaller sites, the cost of dynamic compression on system resources is minor. Websites with larger files and higher traffic volumes will likely see a more significant amount of CPU usage, and would benefit more from static compression.

Gzip is a fast and easy way to improve page speed performance while still delivering a high-quality experience to your users. All other trademarks are the property of their respective owners. With Pingdom's website monitoring you are always the first to know when your site is in trouble, and as a result you are making the Internet faster and more reliable. Nice, huh? Gain availability and performance insights with Pingdom — a comprehensive web application performance and digital experience monitoring tool.

SolarWinds Blog Contact Us. Synthetic Monitoring Simulate visitor interaction with your site to monitor the end user experience. LOG IN. What Exactly is gzip? Using gzip on the Web Web servers use gzip to reduce the total amount of data transferred to clients. Adding gzip to Your Website There are two ways to compress web content: dynamically and statically. Dynamic Compression To enable dynamic compression, just add gzip on; to your global, site, or location configuration block.

Supporting Proxies In some cases, proxy servers e. Static Compression Enabled With static compression, the web server transferred Pingdom Products.



0コメント

  • 1000 / 1000