Welcome! Log In Create A New Profile

Advanced

Re: [Patch] proxy cache for 304 Not Modified

Woon Wai Keen
September 22, 2011 05:00PM
On 2011-09-19 6:47 PM, Maxim Dounin wrote:
> Additional question to consider: what should happen if original
> 200 reply comes with "Cache-Control: max-age=<seconds>" (or
> "Expires:<time>"). Should we use it? Or should we use another
> one from 304 reply?
>
> Please provide rationale based on RFC2616.
I'm most interested in this point you raised.

Excerpt from RFC2616 13.5.3 (snipped only the relevant parts):
> If the status code is 304 (Not Modified), the cache uses the entity-
> body stored in the cache entry as the entity-body of this outgoing
> response.
>
> The end-to-end headers stored in the cache entry are used for the
> constructed response, except that
>
> - any end-to-end headers provided in the 304 or 206 response MUST
> replace the corresponding headers from the cache entry.
Due to this, we need to read the cached headers, merge it with upstream
headers, write the updated cache to a temp file and replace the existing
one.

To avoid the copy IO for some specific use cases where 304s won't have
consequential header updates, it can be sufficient to just update
valid_sec. Of course this would be highly uncompliant with RFC2616...

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[Patch] proxy cache for 304 Not Modified

ビリビリⅤ 2969 September 15, 2011 01:56PM

Re: [Patch] proxy cache for 304 Not Modified

Maxim Dounin 908 September 16, 2011 11:54AM

Re: [Patch] proxy cache for 304 Not Modified

magicbear 1912 September 16, 2011 04:36PM

Re: [Patch] proxy cache for 304 Not Modified

Maxim Dounin 745 September 19, 2011 06:48AM

Re: [Patch] proxy cache for 304 Not Modified

magicbear 1153 September 19, 2011 12:50PM

Re: [Patch] proxy cache for 304 Not Modified

Maxim Dounin 843 September 21, 2011 02:02PM

Re: [Patch] proxy cache for 304 Not Modified

magicbear 1011 September 21, 2011 04:34PM

Re: [Patch] proxy cache for 304 Not Modified

Woon Wai Keen 823 September 22, 2011 05:00PM

Re: [Patch] proxy cache for 304 Not Modified

magicbear 891 September 22, 2011 06:08PM

Re: [Patch] proxy cache for 304 Not Modified

magicbear 1498 September 25, 2011 03:20PM

Re: [Patch] proxy cache for 304 Not Modified

Woon Wai Keen 792 September 19, 2011 04:28PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 175
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