[apologies if this has been asked lots of times before, but searches
really did not turn up anything]
I am using nginx with SSI enabled to assemble pages and page-fragments
from upstream servers.
upstream U1 produces the main page (the one containing SSI include
directives) and wants nginx to cache its response (the page with the
unresolved SSI include directives). Thus U1 sends the main page with
Cache-Control: max-age=60.
The includes come from upstream U2 and are also cacheable from the POV
of U2, hence U2 adds a max-age for those. The max-age could be less than
60 or more than 60.
What I want nginx to do is to cache the upstream response for the main
page and also cache the upstream responses for the includes - which
nginx does as the debug log suggests.
In addition I of course want nginx to strip/adjust the Cache-Control /
max-age when the assembled page is sent to the client.
Unfortunately nginx seems to simply copy the max-age of the main page
upstream response and send it to the client - which is obviously
misleading information since the cacheabilty of the response is unknown
or the lowest max-age of all includes.
Can anyone help me on how I get nginx to at least remove the misleading
Cache-Control header?
On Mon, Jan 19, 2015 at 08:44:33PM +0100, Jan A. wrote:
Hi there,
upstream U1 produces the main page (the one containing SSI include directives)
and wants nginx to cache its response (the page with the unresolved SSI include
directives). Thus U1 sends the main page with Cache-Control: max-age=60.
In addition I of course want nginx to strip/adjust the Cache-Control / max-age
when the assembled page is sent to the client.
Completely untested, but, depending on how you connect to upstream, does
“proxy_hide_header” or “proxy_ignore_headers” do what you want?
On Mon, Jan 19, 2015 at 08:44:33PM +0100, Jan A. wrote:
Hi there,
upstream U1 produces the main page (the one containing SSI include directives)
and wants nginx to cache its response (the page with the unresolved SSI include
directives). Thus U1 sends the main page with Cache-Control: max-age=60.
In addition I of course want nginx to strip/adjust the Cache-Control / max-age
when the assembled page is sent to the client.
Completely untested, but, depending on how you connect to upstream, does
“proxy_hide_header” or “proxy_ignore_headers” do what you want?
Do you have any idea, how I can then best re-add the header? The case
came up that clients need an explicit Cache-Control: no-cache (to ensure
reload of the page when hitting the back button )
Completely untested, but, depending on how you connect to upstream, does
“proxy_hide_header” or “proxy_ignore_headers” do what you want?
Do you have any idea, how I can then best re-add the header? The case came up
that clients need an explicit Cache-Control: no-cache (to ensure reload of the
page when hitting the back button …)