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


##########
docs/zh/latest/plugins/proxy-cache.md:
##########
@@ -23,53 +28,51 @@ title: proxy-cache
 
 ## 描述
 
-代理缓存插件,该插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求 
Method 来指定需要缓存的数据,另外也可以通过 no_cache 和 cache_bypass 配置更复杂的缓存策略。
-
-基于磁盘的缓存需要注意:
-
-1. 不能动态配置缓存的过期时间,只能通过后端服务响应头 Expires 或 Cache-Control 来设置过期时间,如果后端响应头中没有 
Expires 或 Cache-Control,那么 APISIX 将默认只缓存 10 秒钟
-2. 如果后端服务不可用, APISIX 将返回 502 或 504,那么 502 或 504 将被缓存 10 秒钟
+`proxy-cache` 
插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求模式来指定需要缓存的数据,也可以通过
 `no_cache` 和 `cache_bypass`属性配置更复杂的缓存策略。

Review Comment:
   This plugin already supports memory cache. Please modify the English doc too.



##########
docs/zh/latest/plugins/proxy-cache.md:
##########
@@ -23,53 +28,51 @@ title: proxy-cache
 
 ## 描述
 
-代理缓存插件,该插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求 
Method 来指定需要缓存的数据,另外也可以通过 no_cache 和 cache_bypass 配置更复杂的缓存策略。
-
-基于磁盘的缓存需要注意:
-
-1. 不能动态配置缓存的过期时间,只能通过后端服务响应头 Expires 或 Cache-Control 来设置过期时间,如果后端响应头中没有 
Expires 或 Cache-Control,那么 APISIX 将默认只缓存 10 秒钟
-2. 如果后端服务不可用, APISIX 将返回 502 或 504,那么 502 或 504 将被缓存 10 秒钟
+`proxy-cache` 
插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求模式来指定需要缓存的数据,也可以通过
 `no_cache` 和 `cache_bypass`属性配置更复杂的缓存策略。
 
 ## 属性
 
 | 名称               | 类型           | 必选项 | 默认值                    | 有效值         
                                                                 | 描述           
                                                                                
                                    |
 | ------------------ | -------------- | ------ | ------------------------- | 
------------------------------------------------------------------------------- 
| 
----------------------------------------------------------------------------------------------------------------------------------
 |
-| cache_strategy     | string         | 可选   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中 |
-| cache_zone         | string         | 可选   |        disk_cache_one     |     
                                                                            | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 conf/config.yaml 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 conf/config.yaml 文件中预定义的缓存区域不一致,缓存无效。   |
-| cache_key          | array[string]  | 可选   | ["$host", "$request_uri"] |     
                                                                            | 
缓存 key,可以使用变量。例如:["$host", "$uri", "-cache-id"]                                 
                                       |
-| cache_bypass       | array[string]  | 可选   |                           |     
                                                                            | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将会跳过缓存的检索。例如:["$arg_bypass"] |
-| cache_method       | array[string]  | 可选   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存                                  
                                                                   |
-| cache_http_status  | array[integer] | 可选   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据响应码决定是否需要缓存                                                                 
                                        |
-| hide_cache_headers | boolean        | 可选   | false                     |     
                                                                            | 
是否将 Expires 和 Cache-Control 响应头返回给客户端                                           
                                      |
-| cache_control      | boolean        | 可选   | false                     |     
                                                                            | 
是否遵守 HTTP 协议规范中的 Cache-Control 的行为                                 |
-| no_cache           | array[string]  | 可选   |                           |     
                                                                            | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将不会缓存数据                                        
              |
-| cache_ttl          | integer        | 可选   | 300 秒                    |      
                                                                           | 
当选项 cache_control 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间    |
-
-注:变量以$开头,不存在时等价于空字符串。也可以使用变量和字符串的结合,但是需要以数组的形式分开写,最终变量被解析后会和字符串拼接在一起。
-
-在 `conf/config.yaml` 文件中的配置示例:
-
-```yaml
+| cache_strategy     | string         | 否   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中。 |
+| cache_zone         | string         | 否   | disk_cache_one     |             
                                                                    | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 `conf/config.yaml` 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 `conf/config.yaml` 文件中预定义的缓存区域不一致,缓存无效。   |
+| cache_key          | array[string]  | 否   | ["$host", "$request_uri"] |      
                                                                           | 缓存 
key,可以使用变量。例如:`["$host", "$uri", "-cache-id"]`。                                 
                                       |
+| cache_bypass       | array[string]  | 否   |                           |      
                                                                           | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量。需要注意当此参数的值不为空或非 `0` 时将会跳过缓存的检索。例如:`["$arg_bypass"]`。 
|
+| cache_method       | array[string]  | 否   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存。                                 
                                                                    |
+| cache_http_status  | array[integer] | 否   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据 HTTP 响应码决定是否需要缓存。                                                          
                                               |
+| hide_cache_headers | boolean        | 否   | false                     |      
                                                                           | 
是否将 `Expires` 和 `Cache-Control` 响应头返回给客户端。                                      
                                           |

Review Comment:
   ```suggestion
   | hide_cache_headers | boolean        | 否   | false                     |    
                                                                             
|当设置为 `true` 时将 `Expires` 和 `Cache-Control` 响应头返回给客户端。                          
                                                       |
   ```



##########
docs/zh/latest/plugins/proxy-cache.md:
##########
@@ -23,53 +28,51 @@ title: proxy-cache
 
 ## 描述
 
-代理缓存插件,该插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求 
Method 来指定需要缓存的数据,另外也可以通过 no_cache 和 cache_bypass 配置更复杂的缓存策略。
-
-基于磁盘的缓存需要注意:
-
-1. 不能动态配置缓存的过期时间,只能通过后端服务响应头 Expires 或 Cache-Control 来设置过期时间,如果后端响应头中没有 
Expires 或 Cache-Control,那么 APISIX 将默认只缓存 10 秒钟
-2. 如果后端服务不可用, APISIX 将返回 502 或 504,那么 502 或 504 将被缓存 10 秒钟
+`proxy-cache` 
插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求模式来指定需要缓存的数据,也可以通过
 `no_cache` 和 `cache_bypass`属性配置更复杂的缓存策略。
 
 ## 属性
 
 | 名称               | 类型           | 必选项 | 默认值                    | 有效值         
                                                                 | 描述           
                                                                                
                                    |
 | ------------------ | -------------- | ------ | ------------------------- | 
------------------------------------------------------------------------------- 
| 
----------------------------------------------------------------------------------------------------------------------------------
 |
-| cache_strategy     | string         | 可选   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中 |
-| cache_zone         | string         | 可选   |        disk_cache_one     |     
                                                                            | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 conf/config.yaml 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 conf/config.yaml 文件中预定义的缓存区域不一致,缓存无效。   |
-| cache_key          | array[string]  | 可选   | ["$host", "$request_uri"] |     
                                                                            | 
缓存 key,可以使用变量。例如:["$host", "$uri", "-cache-id"]                                 
                                       |
-| cache_bypass       | array[string]  | 可选   |                           |     
                                                                            | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将会跳过缓存的检索。例如:["$arg_bypass"] |
-| cache_method       | array[string]  | 可选   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存                                  
                                                                   |
-| cache_http_status  | array[integer] | 可选   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据响应码决定是否需要缓存                                                                 
                                        |
-| hide_cache_headers | boolean        | 可选   | false                     |     
                                                                            | 
是否将 Expires 和 Cache-Control 响应头返回给客户端                                           
                                      |
-| cache_control      | boolean        | 可选   | false                     |     
                                                                            | 
是否遵守 HTTP 协议规范中的 Cache-Control 的行为                                 |
-| no_cache           | array[string]  | 可选   |                           |     
                                                                            | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将不会缓存数据                                        
              |
-| cache_ttl          | integer        | 可选   | 300 秒                    |      
                                                                           | 
当选项 cache_control 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间    |
-
-注:变量以$开头,不存在时等价于空字符串。也可以使用变量和字符串的结合,但是需要以数组的形式分开写,最终变量被解析后会和字符串拼接在一起。
-
-在 `conf/config.yaml` 文件中的配置示例:
-
-```yaml
+| cache_strategy     | string         | 否   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中。 |
+| cache_zone         | string         | 否   | disk_cache_one     |             
                                                                    | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 `conf/config.yaml` 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 `conf/config.yaml` 文件中预定义的缓存区域不一致,缓存无效。   |
+| cache_key          | array[string]  | 否   | ["$host", "$request_uri"] |      
                                                                           | 缓存 
key,可以使用变量。例如:`["$host", "$uri", "-cache-id"]`。                                 
                                       |
+| cache_bypass       | array[string]  | 否   |                           |      
                                                                           | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量。需要注意当此参数的值不为空或非 `0` 时将会跳过缓存的检索。例如:`["$arg_bypass"]`。 
|
+| cache_method       | array[string]  | 否   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存。                                 
                                                                    |
+| cache_http_status  | array[integer] | 否   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据 HTTP 响应码决定是否需要缓存。                                                          
                                               |
+| hide_cache_headers | boolean        | 否   | false                     |      
                                                                           | 
是否将 `Expires` 和 `Cache-Control` 响应头返回给客户端。                                      
                                           |
+| cache_control      | boolean        | 否   | false                     |      
                                                                           | 
是否遵守 HTTP 协议规范中的 `Cache-Control` 的行为。                                 |
+| no_cache           | array[string]  | 否   |                           |      
                                                                           | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非 `0` 时将不会缓存数据。                                     
                 |

Review Comment:
   ```suggestion
   | no_cache           | array[string]  | 否   |                           |    
                                                                             | 
当此参数的值不为空或非 `0` 时将不会缓存数据,可以使用变量。                                                
     |
   ```



##########
docs/zh/latest/plugins/proxy-cache.md:
##########
@@ -23,53 +28,51 @@ title: proxy-cache
 
 ## 描述
 
-代理缓存插件,该插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求 
Method 来指定需要缓存的数据,另外也可以通过 no_cache 和 cache_bypass 配置更复杂的缓存策略。
-
-基于磁盘的缓存需要注意:
-
-1. 不能动态配置缓存的过期时间,只能通过后端服务响应头 Expires 或 Cache-Control 来设置过期时间,如果后端响应头中没有 
Expires 或 Cache-Control,那么 APISIX 将默认只缓存 10 秒钟
-2. 如果后端服务不可用, APISIX 将返回 502 或 504,那么 502 或 504 将被缓存 10 秒钟
+`proxy-cache` 
插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求模式来指定需要缓存的数据,也可以通过
 `no_cache` 和 `cache_bypass`属性配置更复杂的缓存策略。
 
 ## 属性
 
 | 名称               | 类型           | 必选项 | 默认值                    | 有效值         
                                                                 | 描述           
                                                                                
                                    |
 | ------------------ | -------------- | ------ | ------------------------- | 
------------------------------------------------------------------------------- 
| 
----------------------------------------------------------------------------------------------------------------------------------
 |
-| cache_strategy     | string         | 可选   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中 |
-| cache_zone         | string         | 可选   |        disk_cache_one     |     
                                                                            | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 conf/config.yaml 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 conf/config.yaml 文件中预定义的缓存区域不一致,缓存无效。   |
-| cache_key          | array[string]  | 可选   | ["$host", "$request_uri"] |     
                                                                            | 
缓存 key,可以使用变量。例如:["$host", "$uri", "-cache-id"]                                 
                                       |
-| cache_bypass       | array[string]  | 可选   |                           |     
                                                                            | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将会跳过缓存的检索。例如:["$arg_bypass"] |
-| cache_method       | array[string]  | 可选   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存                                  
                                                                   |
-| cache_http_status  | array[integer] | 可选   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据响应码决定是否需要缓存                                                                 
                                        |
-| hide_cache_headers | boolean        | 可选   | false                     |     
                                                                            | 
是否将 Expires 和 Cache-Control 响应头返回给客户端                                           
                                      |
-| cache_control      | boolean        | 可选   | false                     |     
                                                                            | 
是否遵守 HTTP 协议规范中的 Cache-Control 的行为                                 |
-| no_cache           | array[string]  | 可选   |                           |     
                                                                            | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将不会缓存数据                                        
              |
-| cache_ttl          | integer        | 可选   | 300 秒                    |      
                                                                           | 
当选项 cache_control 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间    |
-
-注:变量以$开头,不存在时等价于空字符串。也可以使用变量和字符串的结合,但是需要以数组的形式分开写,最终变量被解析后会和字符串拼接在一起。
-
-在 `conf/config.yaml` 文件中的配置示例:
-
-```yaml
+| cache_strategy     | string         | 否   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中。 |
+| cache_zone         | string         | 否   | disk_cache_one     |             
                                                                    | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 `conf/config.yaml` 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 `conf/config.yaml` 文件中预定义的缓存区域不一致,缓存无效。   |
+| cache_key          | array[string]  | 否   | ["$host", "$request_uri"] |      
                                                                           | 缓存 
key,可以使用变量。例如:`["$host", "$uri", "-cache-id"]`。                                 
                                       |
+| cache_bypass       | array[string]  | 否   |                           |      
                                                                           | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量。需要注意当此参数的值不为空或非 `0` 时将会跳过缓存的检索。例如:`["$arg_bypass"]`。 
|
+| cache_method       | array[string]  | 否   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存。                                 
                                                                    |
+| cache_http_status  | array[integer] | 否   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据 HTTP 响应码决定是否需要缓存。                                                          
                                               |
+| hide_cache_headers | boolean        | 否   | false                     |      
                                                                           | 
是否将 `Expires` 和 `Cache-Control` 响应头返回给客户端。                                      
                                           |
+| cache_control      | boolean        | 否   | false                     |      
                                                                           | 
是否遵守 HTTP 协议规范中的 `Cache-Control` 的行为。                                 |

Review Comment:
   ```suggestion
   | cache_control      | boolean        | 否   | false                     |    
                                                                             | 
当设置为 `true` 时遵守 HTTP 协议规范中的 `Cache-Control` 的行为。                                
 |
   ```



##########
docs/zh/latest/plugins/proxy-cache.md:
##########
@@ -23,53 +28,51 @@ title: proxy-cache
 
 ## 描述
 
-代理缓存插件,该插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求 
Method 来指定需要缓存的数据,另外也可以通过 no_cache 和 cache_bypass 配置更复杂的缓存策略。
-
-基于磁盘的缓存需要注意:
-
-1. 不能动态配置缓存的过期时间,只能通过后端服务响应头 Expires 或 Cache-Control 来设置过期时间,如果后端响应头中没有 
Expires 或 Cache-Control,那么 APISIX 将默认只缓存 10 秒钟
-2. 如果后端服务不可用, APISIX 将返回 502 或 504,那么 502 或 504 将被缓存 10 秒钟
+`proxy-cache` 
插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求模式来指定需要缓存的数据,也可以通过
 `no_cache` 和 `cache_bypass`属性配置更复杂的缓存策略。
 
 ## 属性
 
 | 名称               | 类型           | 必选项 | 默认值                    | 有效值         
                                                                 | 描述           
                                                                                
                                    |
 | ------------------ | -------------- | ------ | ------------------------- | 
------------------------------------------------------------------------------- 
| 
----------------------------------------------------------------------------------------------------------------------------------
 |
-| cache_strategy     | string         | 可选   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中 |
-| cache_zone         | string         | 可选   |        disk_cache_one     |     
                                                                            | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 conf/config.yaml 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 conf/config.yaml 文件中预定义的缓存区域不一致,缓存无效。   |
-| cache_key          | array[string]  | 可选   | ["$host", "$request_uri"] |     
                                                                            | 
缓存 key,可以使用变量。例如:["$host", "$uri", "-cache-id"]                                 
                                       |
-| cache_bypass       | array[string]  | 可选   |                           |     
                                                                            | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将会跳过缓存的检索。例如:["$arg_bypass"] |
-| cache_method       | array[string]  | 可选   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存                                  
                                                                   |
-| cache_http_status  | array[integer] | 可选   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据响应码决定是否需要缓存                                                                 
                                        |
-| hide_cache_headers | boolean        | 可选   | false                     |     
                                                                            | 
是否将 Expires 和 Cache-Control 响应头返回给客户端                                           
                                      |
-| cache_control      | boolean        | 可选   | false                     |     
                                                                            | 
是否遵守 HTTP 协议规范中的 Cache-Control 的行为                                 |
-| no_cache           | array[string]  | 可选   |                           |     
                                                                            | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将不会缓存数据                                        
              |
-| cache_ttl          | integer        | 可选   | 300 秒                    |      
                                                                           | 
当选项 cache_control 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间    |
-
-注:变量以$开头,不存在时等价于空字符串。也可以使用变量和字符串的结合,但是需要以数组的形式分开写,最终变量被解析后会和字符串拼接在一起。
-
-在 `conf/config.yaml` 文件中的配置示例:
-
-```yaml
+| cache_strategy     | string         | 否   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中。 |
+| cache_zone         | string         | 否   | disk_cache_one     |             
                                                                    | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 `conf/config.yaml` 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 `conf/config.yaml` 文件中预定义的缓存区域不一致,缓存无效。   |
+| cache_key          | array[string]  | 否   | ["$host", "$request_uri"] |      
                                                                           | 缓存 
key,可以使用变量。例如:`["$host", "$uri", "-cache-id"]`。                                 
                                       |
+| cache_bypass       | array[string]  | 否   |                           |      
                                                                           | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量。需要注意当此参数的值不为空或非 `0` 时将会跳过缓存的检索。例如:`["$arg_bypass"]`。 
|

Review Comment:
   ```suggestion
   | cache_bypass       | array[string]  | 否   |                           |    
                                                                             | 
当该属性的值不为空或者非 `0` 时则会跳过缓存检查,即不在缓存中查找数据,可以使用变量,例如:`["$arg_bypass"]`。 |
   ```



##########
docs/zh/latest/plugins/proxy-cache.md:
##########
@@ -23,53 +28,51 @@ title: proxy-cache
 
 ## 描述
 
-代理缓存插件,该插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求 
Method 来指定需要缓存的数据,另外也可以通过 no_cache 和 cache_bypass 配置更复杂的缓存策略。
-
-基于磁盘的缓存需要注意:
-
-1. 不能动态配置缓存的过期时间,只能通过后端服务响应头 Expires 或 Cache-Control 来设置过期时间,如果后端响应头中没有 
Expires 或 Cache-Control,那么 APISIX 将默认只缓存 10 秒钟
-2. 如果后端服务不可用, APISIX 将返回 502 或 504,那么 502 或 504 将被缓存 10 秒钟
+`proxy-cache` 
插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求模式来指定需要缓存的数据,也可以通过
 `no_cache` 和 `cache_bypass`属性配置更复杂的缓存策略。
 
 ## 属性
 
 | 名称               | 类型           | 必选项 | 默认值                    | 有效值         
                                                                 | 描述           
                                                                                
                                    |
 | ------------------ | -------------- | ------ | ------------------------- | 
------------------------------------------------------------------------------- 
| 
----------------------------------------------------------------------------------------------------------------------------------
 |
-| cache_strategy     | string         | 可选   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中 |
-| cache_zone         | string         | 可选   |        disk_cache_one     |     
                                                                            | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 conf/config.yaml 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 conf/config.yaml 文件中预定义的缓存区域不一致,缓存无效。   |
-| cache_key          | array[string]  | 可选   | ["$host", "$request_uri"] |     
                                                                            | 
缓存 key,可以使用变量。例如:["$host", "$uri", "-cache-id"]                                 
                                       |
-| cache_bypass       | array[string]  | 可选   |                           |     
                                                                            | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将会跳过缓存的检索。例如:["$arg_bypass"] |
-| cache_method       | array[string]  | 可选   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存                                  
                                                                   |
-| cache_http_status  | array[integer] | 可选   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据响应码决定是否需要缓存                                                                 
                                        |
-| hide_cache_headers | boolean        | 可选   | false                     |     
                                                                            | 
是否将 Expires 和 Cache-Control 响应头返回给客户端                                           
                                      |
-| cache_control      | boolean        | 可选   | false                     |     
                                                                            | 
是否遵守 HTTP 协议规范中的 Cache-Control 的行为                                 |
-| no_cache           | array[string]  | 可选   |                           |     
                                                                            | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将不会缓存数据                                        
              |
-| cache_ttl          | integer        | 可选   | 300 秒                    |      
                                                                           | 
当选项 cache_control 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间    |
-
-注:变量以$开头,不存在时等价于空字符串。也可以使用变量和字符串的结合,但是需要以数组的形式分开写,最终变量被解析后会和字符串拼接在一起。
-
-在 `conf/config.yaml` 文件中的配置示例:
-
-```yaml
+| cache_strategy     | string         | 否   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中。 |
+| cache_zone         | string         | 否   | disk_cache_one     |             
                                                                    | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 `conf/config.yaml` 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 `conf/config.yaml` 文件中预定义的缓存区域不一致,缓存无效。   |
+| cache_key          | array[string]  | 否   | ["$host", "$request_uri"] |      
                                                                           | 缓存 
key,可以使用变量。例如:`["$host", "$uri", "-cache-id"]`。                                 
                                       |
+| cache_bypass       | array[string]  | 否   |                           |      
                                                                           | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量。需要注意当此参数的值不为空或非 `0` 时将会跳过缓存的检索。例如:`["$arg_bypass"]`。 
|
+| cache_method       | array[string]  | 否   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存。                                 
                                                                    |
+| cache_http_status  | array[integer] | 否   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据 HTTP 响应码决定是否需要缓存。                                                          
                                               |
+| hide_cache_headers | boolean        | 否   | false                     |      
                                                                           | 
是否将 `Expires` 和 `Cache-Control` 响应头返回给客户端。                                      
                                           |
+| cache_control      | boolean        | 否   | false                     |      
                                                                           | 
是否遵守 HTTP 协议规范中的 `Cache-Control` 的行为。                                 |
+| no_cache           | array[string]  | 否   |                           |      
                                                                           | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非 `0` 时将不会缓存数据。                                     
                 |
+| cache_ttl          | integer        | 否   | 300 秒                    |       
                                                                          | 当选项 
`cache_control` 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间。    |
+
+:::note 注意
+
+- 对于基于磁盘的缓存,不能动态配置缓存的过期时间,只能通过后端服务响应头 `Expires` 或 `Cache-Control` 
来设置过期时间,如果后端响应头中没有 `Expires` 或 `Cache-Contro`l,那么 APISIX 将默认只缓存 10 秒钟;
+- 如果后端服务不可用, APISIX 将返回 `502` 或 `504` HTTP 状态码,那么 `502` 或 `504` 将被缓存 10 秒钟;

Review Comment:
   ```suggestion
   - 当上游服务不可用时, APISIX 将返回 `502` 或 `504` HTTP 状态码,默认缓存时间为 10 秒钟;
   ```



##########
docs/zh/latest/plugins/proxy-cache.md:
##########
@@ -23,53 +28,51 @@ title: proxy-cache
 
 ## 描述
 
-代理缓存插件,该插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求 
Method 来指定需要缓存的数据,另外也可以通过 no_cache 和 cache_bypass 配置更复杂的缓存策略。
-
-基于磁盘的缓存需要注意:
-
-1. 不能动态配置缓存的过期时间,只能通过后端服务响应头 Expires 或 Cache-Control 来设置过期时间,如果后端响应头中没有 
Expires 或 Cache-Control,那么 APISIX 将默认只缓存 10 秒钟
-2. 如果后端服务不可用, APISIX 将返回 502 或 504,那么 502 或 504 将被缓存 10 秒钟
+`proxy-cache` 
插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求模式来指定需要缓存的数据,也可以通过
 `no_cache` 和 `cache_bypass`属性配置更复杂的缓存策略。
 
 ## 属性
 
 | 名称               | 类型           | 必选项 | 默认值                    | 有效值         
                                                                 | 描述           
                                                                                
                                    |
 | ------------------ | -------------- | ------ | ------------------------- | 
------------------------------------------------------------------------------- 
| 
----------------------------------------------------------------------------------------------------------------------------------
 |
-| cache_strategy     | string         | 可选   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中 |
-| cache_zone         | string         | 可选   |        disk_cache_one     |     
                                                                            | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 conf/config.yaml 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 conf/config.yaml 文件中预定义的缓存区域不一致,缓存无效。   |
-| cache_key          | array[string]  | 可选   | ["$host", "$request_uri"] |     
                                                                            | 
缓存 key,可以使用变量。例如:["$host", "$uri", "-cache-id"]                                 
                                       |
-| cache_bypass       | array[string]  | 可选   |                           |     
                                                                            | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将会跳过缓存的检索。例如:["$arg_bypass"] |
-| cache_method       | array[string]  | 可选   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存                                  
                                                                   |
-| cache_http_status  | array[integer] | 可选   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据响应码决定是否需要缓存                                                                 
                                        |
-| hide_cache_headers | boolean        | 可选   | false                     |     
                                                                            | 
是否将 Expires 和 Cache-Control 响应头返回给客户端                                           
                                      |
-| cache_control      | boolean        | 可选   | false                     |     
                                                                            | 
是否遵守 HTTP 协议规范中的 Cache-Control 的行为                                 |
-| no_cache           | array[string]  | 可选   |                           |     
                                                                            | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将不会缓存数据                                        
              |
-| cache_ttl          | integer        | 可选   | 300 秒                    |      
                                                                           | 
当选项 cache_control 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间    |
-
-注:变量以$开头,不存在时等价于空字符串。也可以使用变量和字符串的结合,但是需要以数组的形式分开写,最终变量被解析后会和字符串拼接在一起。
-
-在 `conf/config.yaml` 文件中的配置示例:
-
-```yaml
+| cache_strategy     | string         | 否   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中。 |
+| cache_zone         | string         | 否   | disk_cache_one     |             
                                                                    | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 `conf/config.yaml` 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 `conf/config.yaml` 文件中预定义的缓存区域不一致,缓存无效。   |
+| cache_key          | array[string]  | 否   | ["$host", "$request_uri"] |      
                                                                           | 缓存 
key,可以使用变量。例如:`["$host", "$uri", "-cache-id"]`。                                 
                                       |
+| cache_bypass       | array[string]  | 否   |                           |      
                                                                           | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量。需要注意当此参数的值不为空或非 `0` 时将会跳过缓存的检索。例如:`["$arg_bypass"]`。 
|
+| cache_method       | array[string]  | 否   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存。                                 
                                                                    |
+| cache_http_status  | array[integer] | 否   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据 HTTP 响应码决定是否需要缓存。                                                          
                                               |
+| hide_cache_headers | boolean        | 否   | false                     |      
                                                                           | 
是否将 `Expires` 和 `Cache-Control` 响应头返回给客户端。                                      
                                           |
+| cache_control      | boolean        | 否   | false                     |      
                                                                           | 
是否遵守 HTTP 协议规范中的 `Cache-Control` 的行为。                                 |
+| no_cache           | array[string]  | 否   |                           |      
                                                                           | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非 `0` 时将不会缓存数据。                                     
                 |
+| cache_ttl          | integer        | 否   | 300 秒                    |       
                                                                          | 当选项 
`cache_control` 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间。    |
+
+:::note 注意
+
+- 对于基于磁盘的缓存,不能动态配置缓存的过期时间,只能通过后端服务响应头 `Expires` 或 `Cache-Control` 
来设置过期时间,如果后端响应头中没有 `Expires` 或 `Cache-Contro`l,那么 APISIX 将默认只缓存 10 秒钟;

Review Comment:
   ```suggestion
   - 对于基于磁盘的缓存,不能动态配置缓存的过期时间,只能通过后端服务响应头 `Expires` 或 `Cache-Control` 
来设置过期时间,当后端响应头中没有 `Expires` 或 `Cache-Control` 时,默认缓存时间为 10 秒钟;
   ```



##########
docs/zh/latest/plugins/proxy-cache.md:
##########
@@ -23,53 +28,51 @@ title: proxy-cache
 
 ## 描述
 
-代理缓存插件,该插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求 
Method 来指定需要缓存的数据,另外也可以通过 no_cache 和 cache_bypass 配置更复杂的缓存策略。
-
-基于磁盘的缓存需要注意:
-
-1. 不能动态配置缓存的过期时间,只能通过后端服务响应头 Expires 或 Cache-Control 来设置过期时间,如果后端响应头中没有 
Expires 或 Cache-Control,那么 APISIX 将默认只缓存 10 秒钟
-2. 如果后端服务不可用, APISIX 将返回 502 或 504,那么 502 或 504 将被缓存 10 秒钟
+`proxy-cache` 
插件提供缓存后端响应数据的能力,它可以和其他插件一起使用。该插件支持基于磁盘的缓存,未来也会支持基于内存的缓存。目前可以根据响应码、请求模式来指定需要缓存的数据,也可以通过
 `no_cache` 和 `cache_bypass`属性配置更复杂的缓存策略。
 
 ## 属性
 
 | 名称               | 类型           | 必选项 | 默认值                    | 有效值         
                                                                 | 描述           
                                                                                
                                    |
 | ------------------ | -------------- | ------ | ------------------------- | 
------------------------------------------------------------------------------- 
| 
----------------------------------------------------------------------------------------------------------------------------------
 |
-| cache_strategy     | string         | 可选   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中 |
-| cache_zone         | string         | 可选   |        disk_cache_one     |     
                                                                            | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 conf/config.yaml 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 conf/config.yaml 文件中预定义的缓存区域不一致,缓存无效。   |
-| cache_key          | array[string]  | 可选   | ["$host", "$request_uri"] |     
                                                                            | 
缓存 key,可以使用变量。例如:["$host", "$uri", "-cache-id"]                                 
                                       |
-| cache_bypass       | array[string]  | 可选   |                           |     
                                                                            | 
是否跳过缓存检索,即不在缓存中查找数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将会跳过缓存的检索。例如:["$arg_bypass"] |
-| cache_method       | array[string]  | 可选   | ["GET", "HEAD"]           | 
["GET", "POST", "HEAD"] | 根据请求 method 决定是否需要缓存                                  
                                                                   |
-| cache_http_status  | array[integer] | 可选   | [200, 301, 404]           | 
[200, 599]                                                                      
| 根据响应码决定是否需要缓存                                                                 
                                        |
-| hide_cache_headers | boolean        | 可选   | false                     |     
                                                                            | 
是否将 Expires 和 Cache-Control 响应头返回给客户端                                           
                                      |
-| cache_control      | boolean        | 可选   | false                     |     
                                                                            | 
是否遵守 HTTP 协议规范中的 Cache-Control 的行为                                 |
-| no_cache           | array[string]  | 可选   |                           |     
                                                                            | 
是否缓存数据,可以使用变量,需要注意当此参数的值不为空或非'0'时将不会缓存数据                                        
              |
-| cache_ttl          | integer        | 可选   | 300 秒                    |      
                                                                           | 
当选项 cache_control 未开启或开启以后服务端没有返回缓存控制头时,提供的默认缓存时间    |
-
-注:变量以$开头,不存在时等价于空字符串。也可以使用变量和字符串的结合,但是需要以数组的形式分开写,最终变量被解析后会和字符串拼接在一起。
-
-在 `conf/config.yaml` 文件中的配置示例:
-
-```yaml
+| cache_strategy     | string         | 否   | disk                      | 
["disk","memory"]                                                               
| 缓存策略,指定缓存数据存储在磁盘还是内存中。 |
+| cache_zone         | string         | 否   | disk_cache_one     |             
                                                                    | 
指定使用哪个缓存区域,不同的缓存区域可以配置不同的路径,在 `conf/config.yaml` 
文件中可以预定义使用的缓存区域。当不使用默认值时,指定的缓存区域与 `conf/config.yaml` 文件中预定义的缓存区域不一致,缓存无效。   |

Review Comment:
   > 当不使用默认值时,指定的缓存区域与 `conf/config.yaml` 文件中预定义的缓存区域不一致,缓存无效。
   If the default value is used, will the cache be valid if the cache area 
specified by this property is inconsistent with the cache area predefined in 
the `conf/config.yaml` file? Which value is valid?
   
   



-- 
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