How to set the minimum size of the cache file

Ryan Malayter malayter at
Tue Apr 13 16:47:15 MSD 2010

On Tue, Apr 13, 2010 at 4:18 AM, Yahwist Yang <lists at> wrote:
>> Currently there is no way.
>> Could you tell why do you want to set this limit ?
> Hi Igor,
> I have the same question.
> nginx is my reverse proxy cache servers, web page nginx cached was
> generated by backend php program, sometime when php fetch data from db
> server failed, it will generate the wrong page.
> the wrong page's size always much smaller than the right page. if I can
> set the minimum size of the cache file, nginx will not cache the wrong
> page.
> thaks a lot.
>                     yangchunyu

If something went wrong, shouldn't your PHP be generating a 40x or 50x
error code? Nginx doesn't cache these by default.

A third-party web application which returns a 20X code on errors is
currently the bane of my existence. It just plain stinks for
monitoring, log analysis, and just about anything else. If you have
any influence over the back-end PHP code at all, I would change it to
return proper error codes.

More information about the nginx mailing list