How to determine when the response from the cache

xore nginx-forum at
Sat May 12 11:03:48 UTC 2012


Can you please tell how to cope with this task.
When nginx gives directly the page, add the title "backend_id".
And when it taking from the cache, don't add the header.

The scheme works like this:
Frontend - nginx with proxy_cache, followed by multiple backends
(proxy_pass to multiple servers).
I need to distinguish, when a response from the cache and when it from
the backend.
If the response from the backend, i need to understand from which
backend he came.
Backends configured to add a response header backend_id.
But the frontend caches the entire response, with headers.
As a result, you can understand which backend was generated response.
But i can't see, is it direct response, or from the cache.

Are there ways to cope with this task?
Need your wise advice.

Posted at Nginx Forum:,226331,226331#msg-226331

More information about the nginx mailing list