Text object compression by CDN

I was trying to answer the question of “Which CDNs are doing compression from edge to client?”.

The idea being that a CDN should, by default, compress text files. This would be part of their “speeding up the web” strategy.

select * from (
select  count(*),
  lower(regexp_extract(regexp_extract(resp_content_type,r'(^[\w\/\-]+)'),r'\/(?:x-)?(.*)')) as content_type,
from [httparchive:runs.latest_requests] 
where _cdn_provider !='' 
group by content_type,
     ) foo 
where regexp_match(content_type,r'javascript|css|plain') 
and (resp_content_encoding = 'gzip' or resp_content_encoding = '')

The query above will:

  • Normalize content types (for example, turn ‘application/x-javascript’ to ‘javascript’)
  • Only return results were the content encoding is gzip or none (I don’t care about deflate…)
  • Only return results where a CDN was used.
  • Count the number of requsts (for text, javascript, and css) that were gzip compressed versus not, grouping by content type and CDN.

I tossed the results in an Excel sheet to create a pivot chart, here are the results

The majority of CDNs are compressing >90% of their text assets. This is good. However, I didn’t do any analysis on the size of the object at all (ie, are they compressing files that are already small).