Welcome! Log In Create A New Profile

Advanced

subrequest in memory for non-upstream requests

Vincent Gross
December 25, 2013 07:16AM
Hi folks,

After some trial and errors I have a working prototype of arbitrary
external http subrequests, i.e. I can fetch an external resource from a
URL provided at request-time. Basically I spawn an in-memory subrequest
and call ngx_http_upstream_init right after.

subrequest_in_memory only works when there is an upstream. So, if the
resource to be fetched is on the same server, I have 2 options:
1) establish an upstream connection to myself or
2) use an http output filter to catch the subrequest's response body.

To give more context: These requests are used to fetch public key
informations to authenticate http clients, so the contents will not
change often, and it will have a high temporal locality. So basically we
fetch the content the first time, and then we use the content in cache.
Also, the odds that a key is on a foreign server far outranks the odds
that the needed key is on the local server.

What is the best option here ? 1), which is simple and has a low
footprint, but will occasionally use an unnecessary loopback connection;
or 2), which introduce no loopback connections but uses an extra http
output filter to intercept the outbound bytes?

Best regards,

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

subrequest in memory for non-upstream requests

Vincent Gross 783 December 25, 2013 07:16AM



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

Online Users

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