大佬教程收集整理的这篇文章主要介绍了Nginx反向代理:post_action如果代理缓存命中 – Possbile?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我们最近发现了有关Nginxes post_action
的信息.
我们想知道如果进行代理缓存命中,有一种方法可以使用该指令吗?
我们希望的流程如下:
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
如果可以通过post_action或任何其他方法获得任何想法?
这背后的原因如下:
我们本质上希望在显示缓存内容时修改用户会话(php,但相同的概念可以应用于大多数服务器端语言).这将大大增加我们处理的可缓存请求的数量,因为这些请求仅写入会话而不是从会话中读取.
谢谢!
server { listen 80; server_name img1.example; root /var/www/images; LOCATIOn / { // Users request comes in try_files $uri @proxy; // If cache HIT goto A (show) / If cache MISS goto B (@proxy),server cached result post_action /url.php; // post_action to another url on the BACkend } LOCATIOn @proxy { proxy_pass http://static.exmaple; // Server request from BACkend proxy_store /var/www/images$uri; // Store result from BACkend (cachE) } }
以上是大佬教程为你收集整理的Nginx反向代理:post_action如果代理缓存命中 – Possbile?全部内容,希望文章能够帮你解决Nginx反向代理:post_action如果代理缓存命中 – Possbile?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。