Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] proxy_cache_max_range_offset could affect the background updating

Maxim Dounin
December 13, 2022 10:10AM
Hello!

On Mon, Dec 12, 2022 at 07:10:43PM +0400, Sergey Kandaurov wrote:

> > On 7 Dec 2022, at 09:26, Sangdeuk Kwon <sangdeuk.kwon@quantil.com> wrote:
> >
> > # HG changeset patch
> > # User Sangdeuk Kwon <sangdeuk.kwon@quantil.com>
> > # Date 1670390583 -32400
> > # Wed Dec 07 14:23:03 2022 +0900
> > # Node ID a1069fbf10ffd806b7c8d6deb3f6546edc7b0427
> > # Parent 0b360747c74e3fa7e439e0684a8cf1da2d14d8f6
> > proxy_cache_max_range_offset could affect the background updating
> >
> > proxy_cache_max_range_offset doesn't care about the upstream of background updating.
> > So, nginx drops the new cache file after background updating.
> > This behavior is strange because background updating is just to fetch
> > new content after serving a stale cache, not to serve it.
> >
> > I think the background updating should be not affected by proxy_cache_max_range_offset.
> >
>
> Indeed, such configuration with far ranges results in useless background
> (range) subrequests, the response is discarded.
>
> While the behaviour matches the description of proxy_cache_max_range_offset,
> I believe the original intention was to avoid latencies in sending output
> to the client, imposed by obtaining a new full resource from upstream.
> As long as background subrequests don't delay sending output to the client,
> it should be ok to keep caching of (full) response enabled, regardless of
> whether the proxy_cache_max_range_offset limit is hit.

What is expected to happen if background requests are used for
something other than cache updates? For example, such requests
can be created by the mirror module. And I believe njs tried to
use background requests as well.

Also note that the "background subrequests don't delay sending
output to the client" claim is not really correct. They do delay
main request finalization, and therefore can delay further
requests on the same connection.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] proxy_cache_max_range_offset could affect the background updating

Sangdeuk Kwon 448 December 07, 2022 12:28AM

Re: [PATCH] proxy_cache_max_range_offset could affect the background updating

Sergey Kandaurov 89 December 12, 2022 10:12AM

Re: [PATCH] proxy_cache_max_range_offset could affect the background updating

Maxim Dounin 133 December 13, 2022 10:10AM

Re: [PATCH] proxy_cache_max_range_offset could affect the background updating

Sangdeuk Kwon 122 December 12, 2022 11:46PM



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

Online Users

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