The truth about gzip_buffers?

spdyg nginx-forum at
Sat May 18 13:02:14 UTC 2013

Reading the docs on and searching around, it seems there's no
consensus on how we should configure gzip_buffers.

Some guides say that the total buffer needs to be greater than any file you
want to gzip, or it will either not gzip the file or truncate it (I'm sure
this is not true though!).  Other guides suggest arbitrary values.

I guess I have a couple of questions to clear up this confusion:

1. What happens if the response is greater than the total gzip buffer.  Will
it simply keep the upstream connection open longer while it fills, gzips and
transmits the buffers multiple times?

2. If your page size is 4k, does that mean for best efficiency shoudl you
keep the size of the buffers to 4k, but just increase the total number of
buffers?  What is the consideration here?

3. Would having larger buffer sizes potentially allow greater compression
because each buffer is compressed individually?


Posted at Nginx Forum:,239316,239316#msg-239316

More information about the nginx mailing list