small_light_material_dir
The `small_light_material_dir` directive defines the directory for storing temporary image transformations.
Description
This directive is part of the Dynamic Image Transformation Module for NGINX, enabling the server to perform on-the-fly image manipulations. When images are transformed, the resulting temporary files need a designated location to be stored before being served to clients. By specifying the small_light_material_dir, users can control where these temporary files are saved, allowing for better organization or compliance with storage policies. The argument passed to this directive should be the path to the desired directory, and it is crucial that this directory has proper permissions so that the NGINX server can write to it.
In operation, when an image is requested with transformation parameters, the module will check this directory for existing processed images. If an unprocessed image is requested, it will execute the necessary transformations and store the output in this specified small_light_material_dir. This behavior optimizes response times for repeated requests for the same transformation, as subsequent requests can immediately serve the cached version instead of reprocessing the original file. The directive must be placed within the server context, and it expects a single argument specifying the directory path.
Config Example
server {
listen 80;
server_name example.com;
small_light_material_dir /var/tmp/small_light;
}Ensure the specified directory has sufficient write permissions for the NGINX user.
Verify that the directory exists before starting NGINX, as it does not create the directory automatically.
Temporary space must be monitored to prevent running out of disk space due to accumulated files.