# How frequently do servers use chunked encoding for various content types?

**URL:** <https://discuss.httparchive.org/t/how-frequently-do-servers-use-chunked-encoding-for-various-content-types/600>\
**Category:** Analysis\
**Created:** [June 26, 2015, 8:28am UTC](https://discuss.httparchive.org/t/how-frequently-do-servers-use-chunked-encoding-for-various-content-types/600 "2015-06-26T08:28:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![igrigorik](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.httparchive.org/igrigorik/32/925_2.png) [@igrigorik](https://discuss.httparchive.org/u/igrigorik)\
**Post date:** [June 26, 2015, 8:28am UTC](https://discuss.httparchive.org/t/how-frequently-do-servers-use-chunked-encoding-for-various-content-types/600/1 "2015-06-26T08:28:20Z")

</div>

```sql
SELECT mimetype, resp_transfer_encoding, size, 
  ROUND(ratio*100) as percent FROM (
    SELECT mimeType, resp_transfer_encoding, size, 
      RATIO_TO_REPORT(size) OVER(PARTITION BY mimeType) ratio 
    FROM (
      SELECT mimeType, resp_transfer_encoding, 
        count(1) as cnt, sum(respSize) as size
      FROM [runs.2015_04_15_requests] 
      GROUP by mimeType, resp_transfer_encoding
      HAVING cnt > 10000
      ORDER BY mimeType, cnt
    ) 
)

```

- As of 04/2015, ~9% of responses are received via chunked transfers.
- There is significant variation between content types - e.g. 44% of HTML resources are chunked transfers.

---

<div class="post-metadata">

**Author:** ![stevesoudersorg](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.httparchive.org/stevesoudersorg/32/1293_2.png) [@stevesoudersorg](https://discuss.httparchive.org/u/stevesoudersorg)\
**Post date:** [July 13, 2015, 9:18pm UTC](https://discuss.httparchive.org/t/how-frequently-do-servers-use-chunked-encoding-for-various-content-types/600/2 "2015-07-13T21:18:48Z")

</div>

Why isn’t it higher? This is especially important for HTML - since HTML is parsed in streaming fashion.

I tried digging into this further by looking at the Server response header for HTML requests:

```sql
SELECT mimetype, resp_server, resp_transfer_encoding, cnt, size, 
  ROUND(ratio*100) as percent FROM (
    SELECT mimeType, resp_server, resp_transfer_encoding, cnt, size, 
      RATIO_TO_REPORT(size) OVER(PARTITION BY mimeType) ratio 
    FROM (
      SELECT mimeType, resp_server, resp_transfer_encoding, 
        count(1) as cnt, sum(respSize) as size
      FROM [httparchive:runs.2015_04_15_requests] 
      WHERE mimeType like "%html%" and resp_transfer_encoding like "%chunked%"
      GROUP by resp_server, mimeType, resp_transfer_encoding
      HAVING cnt > 10000
    ) 
)
ORDER BY percent desc

```

[FYI - I had to add the “httparchive:” prefix to your query to make it work: “FROM [httparchive:runs.2015\_04\_15\_requests]”.]

The results are kinda interesting:  
 ![](https://yyz1.discourse-cdn.com/flex035/uploads/httparchive/532/db7d3024f2cf3a20.png)

Why is Apache so high?  
Do proxies like Cloudflare not support chunked encoding?

---

<div class="post-metadata">

**Author:** ![igrigorik](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.httparchive.org/igrigorik/32/925_2.png) [@igrigorik](https://discuss.httparchive.org/u/igrigorik)\
**Post date:** [July 13, 2015, 10:37pm UTC](https://discuss.httparchive.org/t/how-frequently-do-servers-use-chunked-encoding-for-various-content-types/600/3 "2015-07-13T22:37:00Z")

</div>

Re, cloudflare: you do see them in #6 with 8% of responses. Not sure about Apache vs others, if you add up all the nginx versions in above lis then you’re also looking at ~20%. The empty tokens (#2) is a security best practice… and that could go in any direction (e.g. in nginx its as simple as `server_tokens off;`).
