sent_http_HEADER Volatile under Nginx 1.2.4

Jonathan Matthews contact at
Mon Dec 16 12:45:22 UTC 2013

On 16 December 2013 12:38, Paul Taylor <me at> wrote:
> Hi Maxim,
> Ok, thanks for the clarification.
> So to confirm, we are looking for the value of the sent header from the
> upstream, to identify whether the content should be served from the cache,
> or the upstream. Does this therefore mean that the code that we have below,
> will check for the X-No-Cache header, and if present, will always render the
> content from the upstream (no cache), and that if not present, will enable
> the result to be cacheable? If so, and it is only the reporting of the
> X-Cache-Status value that is rendering a false value, then this will give us
> what we want?
> If not, then what suggestions would you have for caching only on the basis
> of this sent http header being present?

I may have missed in this thread why the earlier suggestion of

  proxy_no_cache $upstream_http_x_no_cache

doesn't work for you. It does seem to meet your requirement of
"caching only on the basis of this sent [== upstream?] http header
being present" ...


More information about the nginx mailing list