OpenResty--【ngx.location.capture】
介绍 描述 在openResty中,ngx.location.capture_multi是一个非常强大的功能, 其可以达到极大的减少浏览器的http连接数量,并且可以异步并发的访问后台 Java/PHP/Python 等等接口。 可以应用于并发多个相互之间没有依赖的请求。在现代的应用架构中经常使用微服务,提供低粒度的接口;但在客户端(例如:app、网页服务)经常需要请求多个微服务接口,才能完整显示页面内容。 差异 介绍一下下面这几个应用之间的差别; ngx.exec:nginx跳转;跳转到其他的location中执行。但仅限nginx内部的location。 ngx.redirect:和nginx.exec相似,但支持外部跳转。 ngx.location.capture_multi:并发请求;但仅限nginx内部的location。 http包中multi方法:概念上与ngx.location.capture_multi相似,但支持外部接口。 实例 官方 redis sample### http://openresty.org/cn/dynamic-routing-based-on-redis.html 商品介绍 https://blog.csdn.net/u010074988/article/details/90665529 来源: oschina 链接: https://my