Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] When cache file is expired, nginx can make a lot of upstream requests.

Maxim Dounin
April 01, 2020 11:22AM
Hello!

On Tue, Mar 31, 2020 at 01:59:31PM +0900, Sangdeuk Kwon wrote:

> Thank you for your explanation
>
> I have a question.
> Are there any directives for preventing multiple upstream and serving new
> content?
>
> expect case:
> 1st request: get new content from origin and serve new content.
> 2nd request: serve new content.
> 3rd request: serve new content.
>
> "proxy_cache_use stale updating" and "proxy_cache_background_update off"
> case:
> 1st request: get new content from origin and serve new content.
> 2nd request: serve stale content.
> finish 1st request's upstream.
> 3rd request: serve new content.
>
> "proxy_cache_use stale updating" and "proxy_cache_background_update on"
> case:
> 1st request: serve stale content and make subrequest for getting new
> content.
> 2nd request: serve stale content.
> finish 1st request's subrequest.
> 3rd request: serve new content.

As of now the answer is "no", you cannot configure nginx to
avoid multiple upstream requests when updating cache items and
avoid serving stale responses at the same time.

There were some attempts in the past to expand proxy_cache_lock to
updating cache items though. If you are interested, you may want
to check this patch:

http://mailman.nginx.org/pipermail/nginx-devel/2018-December/011710.html

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

[PATCH] When cache file is expired, nginx can make a lot of upstream requests.

Sangdeuk Kwon 326 March 31, 2020 01:00AM

Re: [PATCH] When cache file is expired, nginx can make a lot of upstream requests.

Maxim Dounin 144 April 01, 2020 11:22AM



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

Online Users

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