Francis Daly
December 07, 2018 06:16PM
On Sat, Dec 08, 2018 at 06:40:52AM +0800, yf chu wrote:

Hi there,

> A request is sent from client to nginx, if it did not hit the cache, I hope nginx only caches the response body returned by upstream and send the headers and response body returned by upstream to client.
> If the request hit the cache, I hope nginx can generate new headers and send them with the cached response body to client.

Ok.

What new headers do you want nginx to generate? (And how would you
configure nginx to do so?)

I suspect that stock nginx does not do this; but maybe something could
be done with one of the embedded languages.

I wonder -- would changing the upstream to send an X-Accel-Redirect
header, along with its for-this-response headers, be useful here? If
so, nginx could potentially send the same local file contents, with
fresh-from-upstream headers each time.

That could avoid doing anything with the nginx cache; and all of the
"header generation" logic would be on the upstream server.

And it might be simpler than patching nginx, if that is what is necessary.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Can Nginx only cache reponse body while excluding some response headers?

yf chu December 02, 2018 05:30AM

Re: Can Nginx only cache reponse body while excluding some response headers?

Francis Daly December 07, 2018 05:24PM

Re:Re: Can Nginx only cache reponse body while excluding some response headers?

yf chu December 07, 2018 05:42PM

Re: Re: Can Nginx only cache reponse body while excluding some response headers?

Francis Daly December 07, 2018 06:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 133
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready