Welcome! Log In Create A New Profile

Advanced

Send SubRequest after the Response is shown to the user

February 14, 2012 07:33AM
I tried using post_action but it was causing delay:

I think this is how post_action works, please correct if am wrong.
1-> Nginx get the REQUEST
2-> Nginx receives the RESPONSE generated by PHP
3-> Nginx sends a SUB_REQUEST to 2nd server (using post_action then proxy_pass)
4-> Nginx recieves the RESPONSE from the 2nd server
5-> Nginx shows RESPONSE to user.

Here at stage 3 & 4 there is an unecessary delay. The subrequest I am sending is just for analytics and dont want the response to the user be delayed. The subrequest does not modify the response.

Here is what i want to achieve:
1-> Nginx get the REQUEST
2-> Nginx receives the RESPONSE generated by PHP
3-> Nginx shows RESPONSE to USER.
4-> Nginx generates a SUB_REQUEST to 2nd server
5-> Nginx recieves the RESPONSE from the 2nd server (optional)

Is there any asynchronous module which can be used to achieve the above flow ?

my conf file file looks like this

http {
server {
location /sendlogging
{
internal;
proxy_pass http://localhost:8080/index.php;
}

if($uri = /sendlogging) {
break;
}

location /
{
....
post_action /sendlogging;
}
}
}
Subject Author Posted

Send SubRequest after the Response is shown to the user

rishabh February 14, 2012 07:33AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready