hf400159 commented on code in PR #8252:
URL: https://github.com/apache/apisix/pull/8252#discussion_r1017637392


##########
docs/zh/latest/tutorials/cache-api-responses.md:
##########
@@ -0,0 +1,219 @@
+---
+title: API 缓存
+keywords:
+  - API 网关
+  - Apache APISIX
+  - 缓存
+  - 性能
+description: 本文主要介绍了如何使用 APISIX 处理网关级别的缓存。通过本教程,用户能够了解如何使用 `proxy-cache` 插件为你的 
Web 应用或微服务 API 提升响应效率。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+本文介绍了如何使用 APISIX 来处理网关级别的缓存。通过本教程,你可以了解到如何使用 `proxy-cache` 插件为你的 Web 应用或微服务 
API 提升响应效率。
+
+## 通过缓存提升性能
+
+我们总是希望构建简单快速的 API,但随着 API 请求的并发数增加,如下问题日益凸显,此时考虑使用缓存:
+
+- 请求延时增加,影响用户体验。
+- 高并发传递到数据库,使得数据库查询时间明显增加。
+- API 可用性降低,甚至会时不时发生网络故障。
+
+## API 网关缓存
+
+[缓存](https://en.wikipedia.org/wiki/Cache_(computing))能够将请求的响应存储下来,在下次请求到来时直接使用。在
 Web 应用架构的不同层级中,缓存均有应用,比如:
+
+- 浏览器缓存
+- 边缘缓存或 CDN
+- 服务端缓存(API 缓存)
+- 数据库缓存
+
+本文讨论另一种缓存机制——**反向代理缓存**,通常在 API 
网关中实现,通过在网关中缓存后端服务的响应,以达到减少对后端服务的访问次数,降低请求延迟的目的。
+
+其基本工作原理为:如果 API 网关已经缓存了请求资源的最新副本,则直接用该副本响应请求,不会再请求后端服务;否则,请求将会被转发到对应的后端服务。
+
+## APISIX 网关缓存
+
+在 APISIX 中,用户可通过 `proxy-cache` 插件开启缓存功能。当前支持基于磁盘和内存的缓存。
+
+缓存的数据能够通过响应码(如 `200` 、 `201` )、请求方法(如 `GET` 、 `HEAD` )等进行过滤,也能通过 `no_cache` 、 
`cache_bypass` 等属性配置更复杂的过滤。此外,还可指定缓存过期时间、内存容量等。具体参见[插件属性](https:// APISIX 
.apache.org/docs/ APISIX /plugins/proxy-cache/)。
+
+了解了基本工作原理,下面我们来看一个由 APISIX 团队提供的使用 `proxy-cache` 插件的示例,该示例展现了一个具有单个端点的 ASP.NET 
项目。

Review Comment:
   ```suggestion
   了解了基本工作原理,下面我们来看一个由 APISIX 团队提供的使用 `proxy-cache` 插件的示例,该示例展现了一个具有单个端点的 
ASP.NET 项目。
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to