From b22131b7e038653c0b18b851a82da36ef0aa63cf Mon Sep 17 00:00:00 2001 From: Cedric Maion Date: Mon, 23 Nov 2015 13:52:43 +0100 Subject: [PATCH] Add a note concerning ngx.location.capture buffering all subrequest content --- README.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/README.markdown b/README.markdown index da06da62e6..2b6479cccc 100644 --- a/README.markdown +++ b/README.markdown @@ -3120,6 +3120,7 @@ Nginx's subrequests provide a powerful way to make non-blocking internal request `ngx_postgres`, `ngx_drizzle`, and even ngx_lua itself and etc etc etc. Also note that subrequests just mimic the HTTP interface but there is *no* extra HTTP/TCP traffic *nor* IPC involved. Everything works internally, efficiently, on the C level. +This also mean that subrequests are fully performed and buffered before being returned to Lua: making a subrequest call to a location that can return or stream a large amount of data (including by using sendfile) is probably a bad idea. Subrequests are completely different from HTTP 301/302 redirection (via [ngx.redirect](#ngxredirect)) and internal redirection (via [ngx.exec](#ngxexec)).