6 messages in ru.sysoev.nginxRe: [dev] some questions about subreq...
FromSent OnAttachments
Manlio PerilloMar 27, 2008 4:52 am 
Sergey BochenkovMar 27, 2008 7:28 am 
Manlio PerilloMar 28, 2008 5:21 am 
Sergey BochenkovMar 28, 2008 6:13 am 
Manlio PerilloMar 29, 2008 5:18 am 
Manlio PerilloMar 29, 2008 3:15 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [dev] some questions about subrequestsActions...
From:Manlio Perillo (manl@public.gmane.org)
Date:Mar 29, 2008 5:18:13 am
List:ru.sysoev.nginx

Sergey Bochenkov ha scritto:

[...]

If you need to keep the upstream response in memory, NGX_HTTP_SUBREQUEST_IN_MEMORY flag may be useful for you. You can also set the r->filter_need_in_memory flag in header-filter and read full response body in the body-filter.

Thanks, but I don't think I have the need to keep it in memory; it will complicate the implementation.

I have one more, important, question. When will be the post_subrequest->handler called? Always after ngx_http_subrequest returns?

The ngx_http_subrequest()-function is asyncronous and returns immediately after all appropriate fields of ngx_http_request_t structure will be filled. It doesn't wait for any upstream answer at all.

The handler will be called after the end of the *subrequest*, not the end of ngx_http_subrequest()-function call.

The problem is that you are assuming that the subrequest will make use of the upstream module, but this is not always the case.

What happens if the subrequest will make use of the static module and the file is very small?

Here you can find the appropriate discussion (unfortunately, in russian): http://article.gmane.org/gmane.comp.web.nginx.russian/11160