This is an automated email from the ASF dual-hosted git repository.
xiaoyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shenyu-website.git
The following commit(s) were added to refs/heads/main by this push:
new 249e8d550c [type:fix] fix pic error (#659)
249e8d550c is described below
commit 249e8d550ce6dd37d09a2da43d33b705e150be63
Author: moremind <[email protected]>
AuthorDate: Thu Jul 28 09:43:52 2022 +0800
[type:fix] fix pic error (#659)
---
docs/plugin-center/cache/cache-plugin.md | 143 +++++++++++++++------
.../current/plugin-center/cache/cache-plugin.md | 136 +++++++++++++++-----
.../plugin-center/cache/cache-plugin.md | 136 +++++++++++++++-----
.../shenyu/plugin/cache/cache-plugin-config-en.png | Bin 0 -> 150272 bytes
.../cache/cache-plugin-config-example-en.png | Bin 0 -> 155350 bytes
.../cache/cache-plugin-config-example-zh.png | Bin 0 -> 146889 bytes
.../shenyu/plugin/cache/cache-plugin-config-zh.png | Bin 0 -> 141367 bytes
.../plugin/cache/cache-plugin-selector-en.png | Bin 0 -> 105779 bytes
.../plugin/cache/cache-plugin-selector-zh.png | Bin 0 -> 91734 bytes
.../img/shenyu/plugin/cache/cache-result-check.png | Bin 0 -> 136769 bytes
static/img/shenyu/plugin/cache/cache-result.jpg | Bin 0 -> 62844 bytes
.../plugin-center/cache/cache-plugin.md | 143 +++++++++++++++------
12 files changed, 422 insertions(+), 136 deletions(-)
diff --git a/docs/plugin-center/cache/cache-plugin.md
b/docs/plugin-center/cache/cache-plugin.md
index 4097c84602..55e2ef88ff 100644
--- a/docs/plugin-center/cache/cache-plugin.md
+++ b/docs/plugin-center/cache/cache-plugin.md
@@ -4,22 +4,72 @@ keywords: ["Cache"]
description: Cache Plugin
---
-## Description
+# 1. Overview
-* The `Cache`plugin is able to cache theesults of the target service, allowing
the user to configure the expiration
+## 1.1 Plugin Name
+
+* Cache Plugin
+
+## 1.2 Appropriate Scenario
+
+* Situation where data is not updated frequently and a large number of calls
are required.
+
+* For Situation where data consistency is not required.
+
+## 1.3 Plugin functionality
+
+* The `Cache` plugin is able to cache the results of the target service,
allowing the user to configure the expiration
time of the cached results.
-## Plugin Setting
+## 1.4 Plugin code
+
+* Core Module `shenyu-plugin-cache-handler`.
+* Core Module `shenyu-plugin-cache-redis`.
+* Core Module `shenyu-plugin-cache-memory`.
+
+* Core Class `org.apache.shenyu.plugin.cache.CachePlugin`
+* Core Class `org.apache.shenyu.plugin.cache.redis.RedisCache`
+* Core Class `org.apache.shenyu.plugin.cache.memory.MemoryCache`
+
+## 1.5 Added Since Which shenyu version
+
+* Since 2.4.3
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+
+
+## 2.2 Import pom
+
+* Import cache plugin dependency in `ShenYu Bootstrap`.
+
+```xml
+<!--shenyu cache plugin start-->
+<dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>
+ <version>${project.version}</version>
+</dependency>
+<!--shenyu cache plugin end-->
+```
+
+## 2.3 Enable plugin
+
+- In shenyu-admin --> BasicConfig --> Plugin --> `cache` set Status enabled.
-In `shenyu-admin` --> BasicConfig --> plugin --> `Cache` set to enable.
-
+## 2.4 Config plugin
-Cache currently supports two modes of caching data.
+### 2.4.1 Plugin Config
+
+
+
+* `cacheType`: Cache currently supports two modes of caching data.
* memory:local memory mode
* redis:redis mode
- 
The current default is `local memory mode`, the results of the target service
are stored in the local memory, if the
gateway is deployed by way of cluster, it is not recommended to use `local
memory mode`, it is recommended to
@@ -29,53 +79,74 @@ If you are using `local memory mode`, you only need to
select memory in cacheTyp
If you are using `redis mode`, select redis in cacheType, and the parameters
are as follows
-* database: which database the cache results are stored in, the default is
index database 0.
+* `database`: which database the cache results are stored in, the default is
index database 0.
-* master: default is master.
+* `master`: default is master.
-* mode: the working mode of redis, the default is single-point mode:
`standalone`, in addition to cluster
+* `mode`: the working mode of redis, the default is single-point mode:
`standalone`, in addition to cluster
mode: `cluster`, sentinel mode: `sentinel`.
-* url: configure the IP and port of the redis database, configured by colon
connection, example: `192.168.1.1:6379`.
+* `url`: configure the IP and port of the redis database, configured by colon
connection, example: `192.168.1.1:6379`.
-* password: the password of the redis database, if not, you can not configure.
+* `password`: the password of the redis database, if not, you can not
configure.
-* maxldle: the maximum free connections in the connection pool
+* `maxldle`: the maximum free connections in the connection pool
-* minldle: minimum idle connections in the connection pool
+* `minldle`: minimum idle connections in the connection pool
-* maxActive: the maximum number of connections in the connection pool
+* `maxActive`: the maximum number of connections in the connection pool
-* maxWait: the maximum blocking wait time for the connection pool (use
negative values to indicate no limit) default -1
+* `maxWait`: the maximum blocking wait time for the connection pool (use
negative values to indicate no limit) default -1
-## Plugin Use
+### 2.4.2 Selector Config
-* Add support for `Cache` in the `pom.xml` file of shenyu-bootstrap.
+* Selectors and rules, please refer to: [Selector And Rule
Config](https://shenyu.apache.org/docs/plugin-center/user-guide/admin-usage/selector-and-rule
"Selector And Rule Config") .
-```xml
- <!--shenyu cache plugin start-->
-<dependency>
- <groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>
- <version>${project.version}</version>
-</dependency>
- <!--shenyu cache plugin end-->
-```
+### 2.4.3 Rule Config
-* Selectors and rules, please refer
- to: [Selector And Rule
Config](https://shenyu.apache.org/docs/plugin-center/user-guide/admin-usage/selector-and-rule
"Selector And Rule Config")
- .
+
* Only matching requests will be cached by the Cache plugin for the results of
the target service.
-The parameter `timeoutSecods` in the rule, the value is the target service
result data cache time, the default is 60,
-in `seconds`.
+`timeoutSecods`: the value is the target service result data cache time, the
default is 60, in `seconds`.
+
+Notice: The current version of the Cache plugin uses the url as a unique key
to identify the same request.
+
+## 2.5 Examples
+
+### 2.5.1 Use redis cache request result
+
+#### 2.5.1.1 Plugin Config
+
+
+
+select redis cache type, config redis database, url, mode, password
+
+#### 2.5.1.2 Selector Config
+
+
+
+#### 2.5.1.3 Rule Config
+

-Note: The current version of the Cache plugin uses the url as a unique key to
identify the same request.
+#### 2.5.1.4 Send Request
-## Situation
+* send http request to cache result.
-* Situation where data is not updated frequently and a large number of calls
are required.
+```http request
+### shengyu getway proxy orderSave
+GET http://localhost:9195/http/order/findById?id=123
+Accept: application/json
+Content-Type: application/json
+```
-* For Situation where data consistency is not required.
+#### 2.5.1.5 Check Result
+
+
+
+
+
+# 3. How to disable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `cache` set Status disable.
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/cache/cache-plugin.md
b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/cache/cache-plugin.md
index 9f372cd6f4..1066067996 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/cache/cache-plugin.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/cache/cache-plugin.md
@@ -4,74 +4,146 @@ keywords: ["缓存"]
description: 缓存插件
---
-## 说明
+
+# 1. 概述
+
+## 1.1 插件名称
+
+* 缓存插件
+
+## 1.2 适用场景
+
+* 数据不会频繁更新,而且需要大量调用的场景。
+
+* 对于数据一致性要求不高的场景。
+
+## 1.3 插件功能
* `Cache`插件能够缓存目标服务的结果,允许用户配置缓存结果的失效时间。
-## 插件配置
+## 1.4 插件代码
+
+* 核心模块 `shenyu-plugin-cache-handler`.
+* 核心模块 `shenyu-plugin-cache-redis`.
+* 核心模块 `shenyu-plugin-cache-memory`.
+
+* 核心类 `org.apache.shenyu.plugin.cache.CachePlugin`
+* 核心类 `org.apache.shenyu.plugin.cache.redis.RedisCache`
+* 核心类 `org.apache.shenyu.plugin.cache.memory.MemoryCache`
+
+## 1.5 添加自哪个shenyu版本
+
+* 2.4.3
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+
+
+## 2.2 导入pom
+
+* 在`ShenYu Bootstrap`导入cache插件的依赖。
+
+```xml
+<!--shenyu cache plugin start-->
+<dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>
+ <version>${project.version}</version>
+</dependency>
+<!--shenyu cache plugin end-->
+```
+
+## 2.3 启用插件
在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `Cache` 设置为开启。
-
+## 2.4 配置插件
+
+### 2.4.1 插件配置
+
+
-Cache目前支持两种模式缓存数据:
+* `cacheType`: Cache目前支持两种模式缓存数据
* memory:本地内存模式
* redis:redis模式
-
-
目前默认的是`本地内存模式`,目标服务的结果都存储在本地内存中,如果网关是通过集群的方式部署的,不建议使用`本地内存模式`,推荐使用`redis模式`,目标服务的数据都缓存到redis中。
如果使用的是`本地内存模式`,只需要在cacheType中选择memory即可,其他配置都不需要配置。
如果使用的是`redis模式`,在cacheType中选择redis,参数介绍:
-* database:缓存结果存储到哪个数据库中,默认是索引库0。
+* `database`:缓存结果存储到哪个数据库中,默认是索引库0。
-* master:默认为master。
+* `master`:默认为master。
-* mode:redis的工作模式,默认为单点模式:`standalone`,此外还有集群模式:`cluster`,哨兵模式:`sentinel`。
+* `mode`:redis的工作模式,默认为单点模式:`standalone`,此外还有集群模式:`cluster`,哨兵模式:`sentinel`。
-* url:配置 redis 数据库的IP和端口,通过冒号连接配置,示例:`192.168.1.1:6379`。
+* `url` :配置 redis 数据库的IP和端口,通过冒号连接配置,示例:`192.168.1.1:6379`。
-* password: redis 数据库的密码,如果没有的话,可以不配置。
+* `password`: redis 数据库的密码,如果没有的话,可以不配置。
-* maxldle:连接池中最大空闲连接
+* `maxldle`:连接池中最大空闲连接
-* minldle:连接池中最小空闲连接
+* `minldle`:连接池中最小空闲连接
-* maxActive:连接池最大连接数
+* `maxActive`:连接池最大连接数
-* maxWait:连接池最大阻塞等待时间(使用负值表示没有限制)默认 -1
+* `maxWait`:连接池最大阻塞等待时间(使用负值表示没有限制)默认 -1
-## 插件使用
+### 2.4.2 选择器配置
-* 在网关的 `pom.xml` 文件中添加 `Cache` 的支持。
+*
选择器和规则设置,请参考:[选择器和规则管理](https://shenyu.apache.org/zh/docs/user-guide/admin-usage/selector-and-rule
"选择器和规则管理")。
-```xml
- <!--shenyu cache plugin start-->
-<dependency>
- <groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>
- <version>${project.version}</version>
-</dependency>
- <!--shenyu cache plugin end-->
-```
+### 2.4.3 规则配置
-*
选择器和规则设置,请参考:[选择器和规则管理](https://shenyu.apache.org/zh/docs/user-guide/admin-usage/selector-and-rule
"选择器和规则管理")。
+
* 只有匹配的请求,`Cache`插件才会对目标服务的结果进行缓存。
-规则中参数 `timeoutSecods`,该值为目标服务结果数据缓存时间,默认是60,单位`秒`。
+`timeoutSecods`,该值为目标服务结果数据缓存时间,默认是60,单位`秒`。
+
+注意:当前版本的Cache插件是把url作为唯一key,标识同一个请求的。
+
+## 2.5 示例
+
+### 2.5.1 使用redis缓存请求结果
+
+#### 2.5.1.1 插件配置
+
+
+
+选择redis缓存模式,并且配置redis的数据库,url,模式和密码。
+
+#### 2.5.1.2 选择器配置
+
+
+
+#### 2.5.1.3 规则配置

-注意:当前版本的Cache插件是把url作为唯一key,标识同一个请求的。
+#### 2.5.1.4 发送请求
-## 使用场景
+* 发送请求并且缓存结果
-* 数据不会频繁更新,而且需要大量调用的场景。
+```http request
+### shengyu getway proxy orderSave
+GET http://localhost:9195/http/order/findById?id=123
+Accept: application/json
+Content-Type: application/json
+```
-* 对于数据一致性要求不高的场景。
+#### 2.5.1.5 核验缓存结果
+
+
+
+
+
+# 3. 如何禁用插件
+
+在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `Cache` 设置为关闭。
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/cache/cache-plugin.md
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/cache/cache-plugin.md
index 9f372cd6f4..1066067996 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/cache/cache-plugin.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/cache/cache-plugin.md
@@ -4,74 +4,146 @@ keywords: ["缓存"]
description: 缓存插件
---
-## 说明
+
+# 1. 概述
+
+## 1.1 插件名称
+
+* 缓存插件
+
+## 1.2 适用场景
+
+* 数据不会频繁更新,而且需要大量调用的场景。
+
+* 对于数据一致性要求不高的场景。
+
+## 1.3 插件功能
* `Cache`插件能够缓存目标服务的结果,允许用户配置缓存结果的失效时间。
-## 插件配置
+## 1.4 插件代码
+
+* 核心模块 `shenyu-plugin-cache-handler`.
+* 核心模块 `shenyu-plugin-cache-redis`.
+* 核心模块 `shenyu-plugin-cache-memory`.
+
+* 核心类 `org.apache.shenyu.plugin.cache.CachePlugin`
+* 核心类 `org.apache.shenyu.plugin.cache.redis.RedisCache`
+* 核心类 `org.apache.shenyu.plugin.cache.memory.MemoryCache`
+
+## 1.5 添加自哪个shenyu版本
+
+* 2.4.3
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+
+
+## 2.2 导入pom
+
+* 在`ShenYu Bootstrap`导入cache插件的依赖。
+
+```xml
+<!--shenyu cache plugin start-->
+<dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>
+ <version>${project.version}</version>
+</dependency>
+<!--shenyu cache plugin end-->
+```
+
+## 2.3 启用插件
在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `Cache` 设置为开启。
-
+## 2.4 配置插件
+
+### 2.4.1 插件配置
+
+
-Cache目前支持两种模式缓存数据:
+* `cacheType`: Cache目前支持两种模式缓存数据
* memory:本地内存模式
* redis:redis模式
-
-
目前默认的是`本地内存模式`,目标服务的结果都存储在本地内存中,如果网关是通过集群的方式部署的,不建议使用`本地内存模式`,推荐使用`redis模式`,目标服务的数据都缓存到redis中。
如果使用的是`本地内存模式`,只需要在cacheType中选择memory即可,其他配置都不需要配置。
如果使用的是`redis模式`,在cacheType中选择redis,参数介绍:
-* database:缓存结果存储到哪个数据库中,默认是索引库0。
+* `database`:缓存结果存储到哪个数据库中,默认是索引库0。
-* master:默认为master。
+* `master`:默认为master。
-* mode:redis的工作模式,默认为单点模式:`standalone`,此外还有集群模式:`cluster`,哨兵模式:`sentinel`。
+* `mode`:redis的工作模式,默认为单点模式:`standalone`,此外还有集群模式:`cluster`,哨兵模式:`sentinel`。
-* url:配置 redis 数据库的IP和端口,通过冒号连接配置,示例:`192.168.1.1:6379`。
+* `url` :配置 redis 数据库的IP和端口,通过冒号连接配置,示例:`192.168.1.1:6379`。
-* password: redis 数据库的密码,如果没有的话,可以不配置。
+* `password`: redis 数据库的密码,如果没有的话,可以不配置。
-* maxldle:连接池中最大空闲连接
+* `maxldle`:连接池中最大空闲连接
-* minldle:连接池中最小空闲连接
+* `minldle`:连接池中最小空闲连接
-* maxActive:连接池最大连接数
+* `maxActive`:连接池最大连接数
-* maxWait:连接池最大阻塞等待时间(使用负值表示没有限制)默认 -1
+* `maxWait`:连接池最大阻塞等待时间(使用负值表示没有限制)默认 -1
-## 插件使用
+### 2.4.2 选择器配置
-* 在网关的 `pom.xml` 文件中添加 `Cache` 的支持。
+*
选择器和规则设置,请参考:[选择器和规则管理](https://shenyu.apache.org/zh/docs/user-guide/admin-usage/selector-and-rule
"选择器和规则管理")。
-```xml
- <!--shenyu cache plugin start-->
-<dependency>
- <groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>
- <version>${project.version}</version>
-</dependency>
- <!--shenyu cache plugin end-->
-```
+### 2.4.3 规则配置
-*
选择器和规则设置,请参考:[选择器和规则管理](https://shenyu.apache.org/zh/docs/user-guide/admin-usage/selector-and-rule
"选择器和规则管理")。
+
* 只有匹配的请求,`Cache`插件才会对目标服务的结果进行缓存。
-规则中参数 `timeoutSecods`,该值为目标服务结果数据缓存时间,默认是60,单位`秒`。
+`timeoutSecods`,该值为目标服务结果数据缓存时间,默认是60,单位`秒`。
+
+注意:当前版本的Cache插件是把url作为唯一key,标识同一个请求的。
+
+## 2.5 示例
+
+### 2.5.1 使用redis缓存请求结果
+
+#### 2.5.1.1 插件配置
+
+
+
+选择redis缓存模式,并且配置redis的数据库,url,模式和密码。
+
+#### 2.5.1.2 选择器配置
+
+
+
+#### 2.5.1.3 规则配置

-注意:当前版本的Cache插件是把url作为唯一key,标识同一个请求的。
+#### 2.5.1.4 发送请求
-## 使用场景
+* 发送请求并且缓存结果
-* 数据不会频繁更新,而且需要大量调用的场景。
+```http request
+### shengyu getway proxy orderSave
+GET http://localhost:9195/http/order/findById?id=123
+Accept: application/json
+Content-Type: application/json
+```
-* 对于数据一致性要求不高的场景。
+#### 2.5.1.5 核验缓存结果
+
+
+
+
+
+# 3. 如何禁用插件
+
+在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `Cache` 设置为关闭。
diff --git a/static/img/shenyu/plugin/cache/cache-plugin-config-en.png
b/static/img/shenyu/plugin/cache/cache-plugin-config-en.png
new file mode 100644
index 0000000000..1ac229a7f7
Binary files /dev/null and
b/static/img/shenyu/plugin/cache/cache-plugin-config-en.png differ
diff --git a/static/img/shenyu/plugin/cache/cache-plugin-config-example-en.png
b/static/img/shenyu/plugin/cache/cache-plugin-config-example-en.png
new file mode 100644
index 0000000000..1a5ed80e86
Binary files /dev/null and
b/static/img/shenyu/plugin/cache/cache-plugin-config-example-en.png differ
diff --git a/static/img/shenyu/plugin/cache/cache-plugin-config-example-zh.png
b/static/img/shenyu/plugin/cache/cache-plugin-config-example-zh.png
new file mode 100644
index 0000000000..6d33fc1c6d
Binary files /dev/null and
b/static/img/shenyu/plugin/cache/cache-plugin-config-example-zh.png differ
diff --git a/static/img/shenyu/plugin/cache/cache-plugin-config-zh.png
b/static/img/shenyu/plugin/cache/cache-plugin-config-zh.png
new file mode 100644
index 0000000000..e9df43d85f
Binary files /dev/null and
b/static/img/shenyu/plugin/cache/cache-plugin-config-zh.png differ
diff --git a/static/img/shenyu/plugin/cache/cache-plugin-selector-en.png
b/static/img/shenyu/plugin/cache/cache-plugin-selector-en.png
new file mode 100644
index 0000000000..28a3dccab1
Binary files /dev/null and
b/static/img/shenyu/plugin/cache/cache-plugin-selector-en.png differ
diff --git a/static/img/shenyu/plugin/cache/cache-plugin-selector-zh.png
b/static/img/shenyu/plugin/cache/cache-plugin-selector-zh.png
new file mode 100644
index 0000000000..60c970bad7
Binary files /dev/null and
b/static/img/shenyu/plugin/cache/cache-plugin-selector-zh.png differ
diff --git a/static/img/shenyu/plugin/cache/cache-result-check.png
b/static/img/shenyu/plugin/cache/cache-result-check.png
new file mode 100644
index 0000000000..090c154389
Binary files /dev/null and
b/static/img/shenyu/plugin/cache/cache-result-check.png differ
diff --git a/static/img/shenyu/plugin/cache/cache-result.jpg
b/static/img/shenyu/plugin/cache/cache-result.jpg
new file mode 100644
index 0000000000..cfa05f0a89
Binary files /dev/null and b/static/img/shenyu/plugin/cache/cache-result.jpg
differ
diff --git a/versioned_docs/version-2.4.3/plugin-center/cache/cache-plugin.md
b/versioned_docs/version-2.4.3/plugin-center/cache/cache-plugin.md
index 4097c84602..55e2ef88ff 100644
--- a/versioned_docs/version-2.4.3/plugin-center/cache/cache-plugin.md
+++ b/versioned_docs/version-2.4.3/plugin-center/cache/cache-plugin.md
@@ -4,22 +4,72 @@ keywords: ["Cache"]
description: Cache Plugin
---
-## Description
+# 1. Overview
-* The `Cache`plugin is able to cache theesults of the target service, allowing
the user to configure the expiration
+## 1.1 Plugin Name
+
+* Cache Plugin
+
+## 1.2 Appropriate Scenario
+
+* Situation where data is not updated frequently and a large number of calls
are required.
+
+* For Situation where data consistency is not required.
+
+## 1.3 Plugin functionality
+
+* The `Cache` plugin is able to cache the results of the target service,
allowing the user to configure the expiration
time of the cached results.
-## Plugin Setting
+## 1.4 Plugin code
+
+* Core Module `shenyu-plugin-cache-handler`.
+* Core Module `shenyu-plugin-cache-redis`.
+* Core Module `shenyu-plugin-cache-memory`.
+
+* Core Class `org.apache.shenyu.plugin.cache.CachePlugin`
+* Core Class `org.apache.shenyu.plugin.cache.redis.RedisCache`
+* Core Class `org.apache.shenyu.plugin.cache.memory.MemoryCache`
+
+## 1.5 Added Since Which shenyu version
+
+* Since 2.4.3
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+
+
+## 2.2 Import pom
+
+* Import cache plugin dependency in `ShenYu Bootstrap`.
+
+```xml
+<!--shenyu cache plugin start-->
+<dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>
+ <version>${project.version}</version>
+</dependency>
+<!--shenyu cache plugin end-->
+```
+
+## 2.3 Enable plugin
+
+- In shenyu-admin --> BasicConfig --> Plugin --> `cache` set Status enabled.
-In `shenyu-admin` --> BasicConfig --> plugin --> `Cache` set to enable.
-
+## 2.4 Config plugin
-Cache currently supports two modes of caching data.
+### 2.4.1 Plugin Config
+
+
+
+* `cacheType`: Cache currently supports two modes of caching data.
* memory:local memory mode
* redis:redis mode
- 
The current default is `local memory mode`, the results of the target service
are stored in the local memory, if the
gateway is deployed by way of cluster, it is not recommended to use `local
memory mode`, it is recommended to
@@ -29,53 +79,74 @@ If you are using `local memory mode`, you only need to
select memory in cacheTyp
If you are using `redis mode`, select redis in cacheType, and the parameters
are as follows
-* database: which database the cache results are stored in, the default is
index database 0.
+* `database`: which database the cache results are stored in, the default is
index database 0.
-* master: default is master.
+* `master`: default is master.
-* mode: the working mode of redis, the default is single-point mode:
`standalone`, in addition to cluster
+* `mode`: the working mode of redis, the default is single-point mode:
`standalone`, in addition to cluster
mode: `cluster`, sentinel mode: `sentinel`.
-* url: configure the IP and port of the redis database, configured by colon
connection, example: `192.168.1.1:6379`.
+* `url`: configure the IP and port of the redis database, configured by colon
connection, example: `192.168.1.1:6379`.
-* password: the password of the redis database, if not, you can not configure.
+* `password`: the password of the redis database, if not, you can not
configure.
-* maxldle: the maximum free connections in the connection pool
+* `maxldle`: the maximum free connections in the connection pool
-* minldle: minimum idle connections in the connection pool
+* `minldle`: minimum idle connections in the connection pool
-* maxActive: the maximum number of connections in the connection pool
+* `maxActive`: the maximum number of connections in the connection pool
-* maxWait: the maximum blocking wait time for the connection pool (use
negative values to indicate no limit) default -1
+* `maxWait`: the maximum blocking wait time for the connection pool (use
negative values to indicate no limit) default -1
-## Plugin Use
+### 2.4.2 Selector Config
-* Add support for `Cache` in the `pom.xml` file of shenyu-bootstrap.
+* Selectors and rules, please refer to: [Selector And Rule
Config](https://shenyu.apache.org/docs/plugin-center/user-guide/admin-usage/selector-and-rule
"Selector And Rule Config") .
-```xml
- <!--shenyu cache plugin start-->
-<dependency>
- <groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>
- <version>${project.version}</version>
-</dependency>
- <!--shenyu cache plugin end-->
-```
+### 2.4.3 Rule Config
-* Selectors and rules, please refer
- to: [Selector And Rule
Config](https://shenyu.apache.org/docs/plugin-center/user-guide/admin-usage/selector-and-rule
"Selector And Rule Config")
- .
+
* Only matching requests will be cached by the Cache plugin for the results of
the target service.
-The parameter `timeoutSecods` in the rule, the value is the target service
result data cache time, the default is 60,
-in `seconds`.
+`timeoutSecods`: the value is the target service result data cache time, the
default is 60, in `seconds`.
+
+Notice: The current version of the Cache plugin uses the url as a unique key
to identify the same request.
+
+## 2.5 Examples
+
+### 2.5.1 Use redis cache request result
+
+#### 2.5.1.1 Plugin Config
+
+
+
+select redis cache type, config redis database, url, mode, password
+
+#### 2.5.1.2 Selector Config
+
+
+
+#### 2.5.1.3 Rule Config
+

-Note: The current version of the Cache plugin uses the url as a unique key to
identify the same request.
+#### 2.5.1.4 Send Request
-## Situation
+* send http request to cache result.
-* Situation where data is not updated frequently and a large number of calls
are required.
+```http request
+### shengyu getway proxy orderSave
+GET http://localhost:9195/http/order/findById?id=123
+Accept: application/json
+Content-Type: application/json
+```
-* For Situation where data consistency is not required.
+#### 2.5.1.5 Check Result
+
+
+
+
+
+# 3. How to disable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `cache` set Status disable.