Nginx provides directives to revalidate expired cache items using conditional HTTP requests. Both proxy_cache_revalidate in ngx_http_proxy_module and fastcgi_cache_revalidate in ngx_http_fastcgi_module are disabled by default. Enabling either directive instructs Nginx to verify expired items with the backend server using conditional header fields.
Directive Syntax, Defaults, and Availability
Official Nginx documentation defines identical configuration parameters, defaults, contexts, and version history for both revalidation directives:
- proxy_cache_revalidate:
- Syntax:
proxy_cache_revalidate on | off; - Default:
proxy_cache_revalidate off; - Context:
http,server,location - Availability: Appeared in version 1.5.7.
- Syntax:
- fastcgi_cache_revalidate:
- Syntax:
fastcgi_cache_revalidate on | off; - Default:
fastcgi_cache_revalidate off; - Context:
http,server,location - Availability: Appeared in version 1.5.7.
- Syntax:
Because the default is off, conditional revalidation does not run unless explicitly set to on within the relevant configuration context.
Conditional Request Headers: If-Modified-Since and If-None-Match
For both modules, setting revalidation to on enables revalidation of expired cache items using conditional requests with the If-Modified-Since and If-None-Match header fields.
Client Header Suppression Under Active Caching
In ngx_http_proxy_module, when caching is enabled, Nginx does not pass the following client request headers to the proxied server:
If-Modified-SinceIf-Unmodified-SinceIf-None-MatchIf-MatchRangeIf-Range
Background Updates and Stale Cache Rules
The documentation also defines mechanisms for updating expired items in the background while returning stale responses:
- FastCGI module:
fastcgi_cache_background_update(appeared in version 1.11.10; defaultoff; contexthttp,server,location) allows starting a background subrequest to update an expired cache item while returning a stale cached response to the client. The documentation specifies that it is necessary to allow the usage of a stale cached response when it is being updated, which is configured viafastcgi_cache_use_staleusing theupdatingparameter. - Proxy module: The proxy module excerpt similarly documents that starting a background subrequest to update an expired cache item while returning a stale response requires allowing stale response usage when updating, configured via
proxy_cache_use_stalewith theupdatingparameter.

Text version of the diagrams
- Proxy vs FastCGI Revalidation: Proxy cache — proxy_cache_revalidate; Shared behavior — Conditional cache checks; FastCGI cache — fastcgi_cache_revalidate
- Revalidation vs Background Update: Revalidation — Checks expired content; Background update — Refreshes expired content; Stale response — Served while updating
Research Method and Documented Limitations
This article was prepared strictly from the supplied public documentation excerpts for ngx_http_proxy_module and ngx_http_fastcgi_module. It does not report hands-on benchmarking, lab testing, or unverified operational inferences.
Material limitations of the visible evidence include truncated module passages, the absence of upstream 304 response handling details, and the lack of variable definitions such as $upstream_cache_status. In addition, the reviewed DigitalOcean competitor page contained only generic portal text and offered no technical coverage of Nginx cache revalidation.



