ssi_last_modified

The ssi_last_modified directive enables or disables the generation of Last-Modified headers for files processed by Server Side Includes (SSI).

Syntaxssi_last_modified on | off;
Defaultoff
Contexthttp, server, location
Argumentsflag

Description

The ssi_last_modified directive is used within the NGINX HTTP Core module to control whether NGINX should send the Last-Modified HTTP header for files that are embedded and processed by Server Side Includes (SSI). When this directive is enabled (set to 'on'), NGINX will inspect the timestamps of the included files and generate appropriate Last-Modified headers based on the most recent modification time of these files. This can be useful for caching mechanisms and helps clients determine whether they need to fetch a fresh version of the resource or if the cached version is still valid. When set to 'off', the Last-Modified header will not be generated, which might reduce the overhead for some use cases where caching is not a concern.

Config Example

location / {
    ssi on;
    ssi_last_modified on;
}

Ensure that SSI is enabled for the configuration to take effect, otherwise, the directive will have no impact.

Using this directive in locations where SSI is not processed will result in a configuration error.

Setting this directive to 'on' may lead to unnecessary overhead if the included files do not change frequently.

← Back to all directives