# How to turn on chunked\_transfer\_encoding for static files

**URL:** <https://www.ruby-forum.com/t/how-to-turn-on-chunked-transfer-encoding-for-static-files/224568>\
**Category:** NGINX\
**Created:** [November 17, 2012, 4:59am UTC](https://www.ruby-forum.com/t/how-to-turn-on-chunked-transfer-encoding-for-static-files/224568 "2012-11-17T04:59:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 17, 2012, 4:59am UTC](https://www.ruby-forum.com/t/how-to-turn-on-chunked-transfer-encoding-for-static-files/224568/1 "2012-11-17T04:59:38Z")

</div>

Hi, All,  
I use nginx 1.2.4  
I want to use chunked\_transfer\_encoding sending to client for  
static files , but I found the “chunked\_transfer\_encoding” is not work  
for static files ( found code in ngx\_http\_chunked\_header\_filter() ) , I  
change the code for call ngx\_http\_clear\_content\_length() ) , and the  
chunked function works .

BUT the nginx send a very big chunk (just equal to file size) , I  
want set the chunk size to 1MB , how to set it ?

---

<div class="post-metadata">

**Author:** ![azure\_peng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@azure\_peng](https://www.ruby-forum.com/u/azure_peng)\
**Post date:** [November 17, 2012, 3:32pm UTC](https://www.ruby-forum.com/t/how-to-turn-on-chunked-transfer-encoding-for-static-files/224568/2 "2012-11-17T15:32:18Z")

</div>

On Saturday 17 November 2012 07:58:49 azure peng wrote:

> Hi, All,  
> I use nginx 1.2.4  
> I want to use chunked\_transfer\_encoding sending to client for  
> static files , but I found the “chunked\_transfer\_encoding” is not work  
> for static files ( found code in ngx\_http\_chunked\_header\_filter() ) , I  
> change the code for call ngx\_http\_clear\_content\_length() ) , and the  
> chunked function works .  
> […]

I’m really curious, why do you want this?

wbr, Valentin V. Bartenev

–

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![azure\_peng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@azure\_peng](https://www.ruby-forum.com/u/azure_peng)\
**Post date:** [November 18, 2012, 10:10am UTC](https://www.ruby-forum.com/t/how-to-turn-on-chunked-transfer-encoding-for-static-files/224568/3 "2012-11-18T10:10:06Z")

</div>

Just for follow the customer’s technique standard :\<
