# Nginx1.0.15 stable, cut off a 16k js static file into 2.03k

**URL:** <https://www.ruby-forum.com/t/nginx1-0-15-stable-cut-off-a-16k-js-static-file-into-2-03k/226284>\
**Category:** NGINX\
**Created:** [June 6, 2012, 6:31am UTC](https://www.ruby-forum.com/t/nginx1-0-15-stable-cut-off-a-16k-js-static-file-into-2-03k/226284 "2012-06-06T06:31:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenmin7249](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chenmin7249](https://www.ruby-forum.com/u/chenmin7249)\
**Post date:** [June 6, 2012, 6:31am UTC](https://www.ruby-forum.com/t/nginx1-0-15-stable-cut-off-a-16k-js-static-file-into-2-03k/226284/1 "2012-06-06T06:31:55Z")

</div>

nginx version 1.0.15 stable  
im running into a problem the a 16k static file was cut off into a 2.03k  
incomplete file occasionally, 7 times of 10 will get the incomplete  
file.  
i use the nginx server for pure static file serving  
sendfile on,  
tcp\_nopush on,  
tcp\_nodelay on,  
keepalive timeout 0,  
gzip off  
open\_file\_cache on  
using epoll  
no other configurations, what could be the problem? client body size?

Posted at Nginx Forum:

> **[nginx1.0.15 stable, cut off a 16k js static file into 2.03k](https://forum.nginx.org/read.php?2,227254,227254#msg-227254)**
>
> nginx version 1.0.15 stable im running into a problem the a 16k static file was cut off into a 2.03k incomplete file occasionally, 7 times of 10 will get the incomplete file. i use the nginx server for pure static file serving sendfile on, tcp\_nopush...

---

<div class="post-metadata">

**Author:** ![chenmin7249](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chenmin7249](https://www.ruby-forum.com/u/chenmin7249)\
**Post date:** [June 6, 2012, 6:45am UTC](https://www.ruby-forum.com/t/nginx1-0-15-stable-cut-off-a-16k-js-static-file-into-2-03k/226284/2 "2012-06-06T06:45:22Z")

</div>

A few suggestions:  
1°) tcp\_nodelay on; is useless, as the default  
value[http://wiki.nginx.org/HttpCoreModule#tcp\_nodelay](http://wiki.nginx.org/HttpCoreModule#tcp_nodelay)is ‘on’ already  
2°) Is tcp\_nopush a really necessary option? Forcing things on packets  
is  
non-natural ([GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpCoreModule#tcp_nopush)). Maybe  
problems come from that  
3°) I’d suggest to test with the latest stable (1.2.1 since today).  
Maybe  
it won’t solve the pb but the latest binary is always a good thing to  
have

## Wild guesses, I am no expert :o\

_B. R._

---

<div class="post-metadata">

**Author:** ![chenmin7249](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chenmin7249](https://www.ruby-forum.com/u/chenmin7249)\
**Post date:** [June 6, 2012, 6:55am UTC](https://www.ruby-forum.com/t/nginx1-0-15-stable-cut-off-a-16k-js-static-file-into-2-03k/226284/3 "2012-06-06T06:55:53Z")

</div>

thx B.R, i will try to put nopush off to verify the problem

Posted at Nginx Forum:

> **[Re: nginx1.0.15 stable, cut off a 16k js static file into 2.03k](https://forum.nginx.org/read.php?2,227254,227257#msg-227257)**
>
> nginx version 1.0.15 stable im running into a problem the a 16k static file was cut off into a 2.03k incomplete file occasionally, 7 times of 10 will get the incomplete file. i use the nginx server for pure static file serving sendfile on, tcp\_nopush...

---

<div class="post-metadata">

**Author:** ![chenmin7249](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chenmin7249](https://www.ruby-forum.com/u/chenmin7249)\
**Post date:** [June 6, 2012, 7:01am UTC](https://www.ruby-forum.com/t/nginx1-0-15-stable-cut-off-a-16k-js-static-file-into-2-03k/226284/4 "2012-06-06T07:01:43Z")

</div>

problem solved:  
the problem is due to that a new file (16k) replaced the old one  
(2.03k), and the cache only refreshed the file content, but not the file  
size, so if the file cache is not expired, client may get the right file  
but the wrong size, which cause the file to be truncated.  
thx B.R, again

Posted at Nginx Forum:

> **[Re: nginx1.0.15 stable, cut off a 16k js static file into 2.03k](https://forum.nginx.org/read.php?2,227254,227258#msg-227258)**
>
> nginx version 1.0.15 stable im running into a problem the a 16k static file was cut off into a 2.03k incomplete file occasionally, 7 times of 10 will get the incomplete file. i use the nginx server for pure static file serving sendfile on, tcp\_nopush...

---

<div class="post-metadata">

**Author:** ![chenmin7249](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chenmin7249](https://www.ruby-forum.com/u/chenmin7249)\
**Post date:** [June 6, 2012, 7:05am UTC](https://www.ruby-forum.com/t/nginx1-0-15-stable-cut-off-a-16k-js-static-file-into-2-03k/226284/5 "2012-06-06T07:05:14Z")

</div>

Hi,

On Wed, Jun 6, 2012 at 12:30 PM, chenmin7249 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> open\_file\_cache on  
> using epoll  
> no other configurations, what could be the problem? client body size?

You could try turning off the ‘open\_file\_cache’ directive. The file size  
info might not be updated if the file is in file cache then being  
changed.

Regards,
