Welcome! Log In Create A New Profile

Advanced

How to adjust Cache-Control for SSI-including entities

Jan Algermissen
January 19, 2015 02:46PM
Hi,

[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?

ssi_last_modified is related and yields the correct default behavior: http://nginx.org/en/docs/http/ngx_http_ssi_module.html#ssi_last_modified

Jan
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to adjust Cache-Control for SSI-including entities

Jan Algermissen January 19, 2015 02:46PM

Re: How to adjust Cache-Control for SSI-including entities

Francis Daly January 19, 2015 03:40PM

Re: How to adjust Cache-Control for SSI-including entities

Jan Algermissen January 19, 2015 04:22PM

Re: How to adjust Cache-Control for SSI-including entities

itpp2012 January 19, 2015 04:39PM

Re: How to adjust Cache-Control for SSI-including entities

Jan Algermissen January 20, 2015 05:50AM

Re: How to adjust Cache-Control for SSI-including entities

Francis Daly January 20, 2015 07:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 123
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready