ssi_min_file_chunk
The `ssi_min_file_chunk` directive specifies the minimum size of file chunks to be processed in instances of Server Side Includes (SSI).
Description
The ssi_min_file_chunk directive in NGINX controls the size of the file chunks that SSI processes when including files within the response body. The primary purpose of this directive is to optimize the handling of SSI files by defining a minimum threshold. If a file being included is smaller than this specified size, the server attempts to read and process it in a single operation, while larger files may be split into multiple chunks for efficient processing. Thus, adjusting this value can influence performance, especially when dealing with numerous concurrent requests or large files.
The directive takes a numerical argument, which represents the size in bytes. A typical use case would involve setting a modest chunk size, ensuring that files that are too big are divided appropriately to avoid overwhelming the memory buffers, while avoiding excessively small chunks that can add to processing overhead. It is advisable to select a balance that suits the expected workload and file sizes in use. The directive can be set in the http, server, or location contexts, allowing for flexible configuration depending on different needs across your sites or applications.
Config Example
http {
ssi on;
ssi_min_file_chunk 2048;
}Setting this value too high may lead to high memory consumption for large SSI files.
If not set, default processing behavior may result in performance issues for very small files.