This is an automated email from the ASF dual-hosted git repository.
monkeydluffy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 9993bbbbb docs: explain in more details for the batch-requests plugin
(#9629)
9993bbbbb is described below
commit 9993bbbbb139cab312e7581836ac35da5fe51500
Author: Liu Wei <[email protected]>
AuthorDate: Wed Jun 28 09:56:41 2023 +0800
docs: explain in more details for the batch-requests plugin (#9629)
---
docs/en/latest/plugins/batch-requests.md | 10 ++++++----
docs/zh/latest/plugins/batch-requests.md | 8 +++++---
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/docs/en/latest/plugins/batch-requests.md
b/docs/en/latest/plugins/batch-requests.md
index dfca137ba..21c28d425 100644
--- a/docs/en/latest/plugins/batch-requests.md
+++ b/docs/en/latest/plugins/batch-requests.md
@@ -29,15 +29,17 @@ description: This document contains information about the
Apache APISIX batch-re
## Description
-The `batch-requests` plugin accepts multiple requests, sends them from APISIX
via [HTTP pipelining](https://en.wikipedia.org/wiki/HTTP_pipelining), and
returns an aggregated response to the client.
+After enabling the batch-requests plugin, users can assemble multiple requests
into one request and send them to the gateway. The gateway will parse the
corresponding requests from the request body and then individually encapsulate
them into separate requests. Instead of the user initiating multiple HTTP
requests to the gateway, the gateway will use the HTTP pipeline method, go
through several stages such as route matching, forwarding to the corresponding
upstream, and then return the co [...]
-This improves the performance significantly in cases where the client needs to
access multiple APIs.
+
+
+In cases where the client needs to access multiple APIs, this will
significantly improve performance.
:::note
-The HTTP headers for the outer batch request (except for `Content-` headers
like `Content-Type`) apply to every request in the batch.
+The request headers in the user’s original request (except for headers
starting with “Content-”, such as “Content-Type”) will be assigned to each
request in the HTTP pipeline. Therefore, to the gateway, these HTTP pipeline
requests sent to itself are no different from external requests initiated
directly by users. They can only access pre-configured routes and will undergo
a complete authentication process, so there are no security issues.
-If the same HTTP header is specified in both the outer request and on an
individual call, the header of the individual call takes precedence.
+If the request headers of the original request conflict with those configured
in the plugin, the request headers configured in the plugin will take
precedence (except for the real_ip_header specified in the configuration file).
:::
diff --git a/docs/zh/latest/plugins/batch-requests.md
b/docs/zh/latest/plugins/batch-requests.md
index 4eb895a09..276dd805c 100644
--- a/docs/zh/latest/plugins/batch-requests.md
+++ b/docs/zh/latest/plugins/batch-requests.md
@@ -29,15 +29,17 @@ description: 本文介绍了关于 Apache APISIX `batch-request` 插件的基本
## 描述
-`batch-requests` 插件可以一次接受多个请求并以 [HTTP
pipeline](https://en.wikipedia.org/wiki/HTTP_pipelining) 的方式在网关发起多个 HTTP
请求,合并结果后再返回客户端。
+在启用 `batch-requests`
插件后,用户可以通过将多个请求组装成一个请求的形式,把请求发送给网关,网关会从请求体中解析出对应的请求,再分别封装成独立的请求,以 [HTTP
pipeline](https://en.wikipedia.org/wiki/HTTP_pipelining) 的方式代替用户向网关自身再发起多个 HTTP
请求,经历路由匹配,转发到对应上游等多个阶段,合并结果后再返回客户端。
+
+
在客户端需要访问多个 API 的情况下,这将显著提高性能。
:::note
-外部批处理请求的 HTTP 请求头(除了以 `Content-` 开始的请求头,例如:`Content-Type`)适用于**批处理**中的每个请求。
+用户原始请求中的请求头(除了以 `Content-` 开始的请求头,例如:`Content-Type`)将被赋给 HTTP pipeline
中的每个请求,因此对于网关来说,这些以 HTTP pipeline
方式发送给自身的请求与用户直接发起的外部请求没有什么不同,只能访问已经配置好的路由,并将经历完整的鉴权过程,因此不存在安全问题。
-如果在外部请求和单个调用中都指定了相同的 HTTP 请求头,则单个调用的请求头优先。
+如果原始请求的请求头与插件中配置的请求头冲突,则以插件中配置的请求头优先(配置文件中指定的 real_ip_header 除外)。
:::