How many text files are not served with gzip?

I would update that query to also include requests where type="xml". The values of the type column also did not contain js or json, since they were represented with type="script".

Here’s a query that looks at all of the type values, and summarizes the percentage of uncompressed content:

SELECT type,
       COUNT(*) total,
       SUM(IF(resp_content_encoding!="gzip" AND resp_content_encoding!="deflate" AND resp_content_encoding!="brotli",1,0)) uncompresed_text,
       ROUND(SUM(IF(resp_content_encoding!="gzip" AND resp_content_encoding!="deflate" AND resp_content_encoding!="brotli",1,0)) / COUNT(*),2) percent_uncompressed
FROM httparchive.runs.2017_09_15_requests  
GROUP BY type
ORDER BY total DESC

When looking at the results for this, you can see the type values that are textual are script, html, css, xml and text. You can see that 27% of script resources are uncompressed, along with 61% of html, 28% of css, 47% of xml, etc

image

If we combine the textual content and look at the overall percentage of uncompressed text resources - we get approximately 36% of text based content is not being compressed.

SELECT SUM(IF(type="script" OR type="html" OR type="css" OR type="xml" OR type="text",1,0)) text,
       SUM(IF(type="script" OR type="html" OR type="css" OR type="xml" OR type="text",IF(resp_content_encoding!="gzip" AND resp_content_encoding!="deflate" AND resp_content_encoding!="brotli",1,0),0)) uncompresed_text,
       ROUND(SUM(IF(type="script" OR type="html" OR type="css" OR type="xml" OR type="text",IF(resp_content_encoding!="gzip" AND resp_content_encoding!="deflate" AND resp_content_encoding!="brotli",1,0),0)) /SUM(IF(type="script" OR type="html" OR type="css" OR type="xml" OR type="text",1,0)),2) UncompressedText
FROM httparchive.runs.2017_09_15_requests

image

Michael Gooding and Gareth Hughes did a Fluent presentation (June 2017) where they looked at similar data for gzip and brotli compression per domain to understand not just the percentage of resources that were compressed overall, but also look at histograms of resources compressed per url. The slides for that are here - https://www.slideshare.net/GarethHughes3/tldr-web-performance-workshop (slides 35 and 37 have content related to this)

2 Likes