O'Reilly logo

Nginx HTTP Server - Fourth Edition by Clement Nedelcu, Martin Fjordvald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Caching, buffering, and temporary files

Ideally, as much as possible, you should reduce the amount of requests being forwarded to the backend server. The following directive will help you build a caching system, as well as control buffering options and the way Nginx handles temporary files:

Directive

Description

proxy_buffer_size

Context: httpserverlocation

Sets the size of the buffer for reading the beginning of the response from the backend server, which usually contains simple header data.

The default value corresponds to the size of 1 buffer, as defined by the previous directive  (proxy_buffers).

Syntax: Numeric value (size)

Example: proxy_buffer_size 4k;

proxy_buffering, proxy_request_buffering

Context: http

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required