HTTP directives
open_file_cache directive (HTTP)
Cache filesystem lookup information and open descriptors, not HTTP response bodies. Use a small bound for a static-site lab. Context: http, server, location. Documented default: off. Version: Introduction not established. OSS documentation; check target build. Lookup error caching is separately controlled; consider stale metadata after deployment. Example is a partial http configuration fragment; use a disposable lab, not a production tuning prescription.
Formal Syntax & Structure
nginx syntaxnginx
open_file_cache off | max=N [inactive=time];Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| mode_or_max | off | max=positive integer | Disable or cap the number of entries. |
| inactive | inactive=duration | Remove entries after inactivity; default 60s when enabled. |
Working Example
Example Snippetnginx
open_file_cache max=128 inactive=45s;