Welcome! Log In Create A New Profile

Advanced

Re: nginx subrequests / background operations

Maxim Dounin
June 06, 2014 08:18AM
Hello!

On Fri, Jun 06, 2014 at 12:57:38AM -0400, Ameir Abdeldayem wrote:

> Hello,
>
> I am investigating the complexity of allowing for an additional parameter,
> "expired", to proxy_cache_use_stale.
>
> Instead of a request hitting the backend with an $upstream_cache_status of
> EXPIRED and making the client wait for the request to complete, the client
> would instead be given a stale version of that cached entry, and that entry
> would be updated in the background.

This is what the "proxy_cache_use_stale updating" does for years,
with the only difference that the update is done by the first
request instead of background.

So, basically, what you are trying to optimize is a single request
per a resource expiration. I would recommend you to reconsider if
it actually worth the effort.

> I was looking into ngx_http_subrequest() as a potential route to take, but
> it looks like it's blocking (as in the client would have to wait for it to
> complete). I also looked at post_action, but it's unclear on whether it's
> blocking or not, and whether it'd work for this case.

The post_action functionality will block a connection as well.

If you want something to happen "in the background", you'll have
to introduce the "in the background" notion in the first place.
Most simple approach seems to be to create a separate "fake"
request with emulated properties and a closed connection.

--
Maxim Dounin
http://nginx.org/

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

nginx subrequests / background operations

Ameir Abdeldayem 844 June 06, 2014 12:58AM

Re: nginx subrequests / background operations

Maxim Dounin 363 June 06, 2014 08:18AM

RE: nginx subrequests / background operations

Ameir Abdeldayem 358 June 07, 2014 01:38AM

Re: nginx subrequests / background operations

Maxim Dounin 360 June 08, 2014 03:14PM

RE: nginx subrequests / background operations

bbarker5025 . 399 June 08, 2014 04:02PM



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

Online Users

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