Nginx Reverse Proxy : post_action if proxy cache hit - Possbile?

Posted by anonymous-one on Server Fault See other posts from Server Fault or by anonymous-one
Published on 2012-09-08T13:47:26Z Indexed on 2012/09/08 15:40 UTC
Read the original article Hit count: 276

Filed under:
|
|

We have recently found out about nginxes post_action.

We were wondering it there was a way to use this directive if a proxy cache hit is made?

The flow we were hoping on is as follows:

1) User request comes in
2) If cache HIT goto A / If cache MISS goto B

A) 1) Serve Cached Result
A) 2) post_action to another url on the backend

B) 1) Server request from backend
B) 2) Store result from backend

Any ideas if this is possible via post_action?

Thanks!

© Server Fault or respective owner

Related posts about nginx

Related posts about reverse-proxy