I am trying to configure nginx proxy_cache so that it stores a cached
copy
of a HTTP response, but serves from cache only under the conditions
defined by proxy_cache_use_stale.
“0s” appears to avoid caching completely. “1s” stores a cached copy,
but
presumably serves from cache for one second. I am trying to serve from
cache only when the upstream errs.
Put another way – can I store/cache all content from the proxied
upstream
(up to the limits defined in proxy_cache_path), but serve from the cache
only when the proxied upstream fails (e.g. timeout, error)?
We have content that should be dynamic, and hence every request should
be
transparently proxied. However, I want to protect against the situation
when the upstream is down or having trouble. Serving a stale response
(though normally undesirable), is better than returning an error.
Thank you
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.