Skip to content

Commit

Permalink
📝 Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP committed Apr 3, 2021
1 parent 4edb97c commit 9d48991
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
18 changes: 14 additions & 4 deletions docs/advance/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,32 @@ Set the parameters related to CC protection.
* `buffer_size`: used to set the size of the memory for recording IP accesses, such as `10m`, `10240k`, must not be less than `10m`, if not specified then the default is `10m`.


## `waf_cache_size`
## `waf_cache`

* syntax: `waf_cache_size <capacity> [interval] [percent];`
* syntax: `waf_cache <capacity> [interval] [percent];`
* default: ——
* context: server

Set parameters related to caching rule inspection results.

* `capacity`: For some inspections with the caching mechanism enabled, the maximum number of inspection results for each inspection target is cached.
* `interval`: Sets the period of the batch cache phase-out in minutes. If not specified, the default is `60`, which is 60 minutes.
* `interval`: Used to set the period of batch cache cleaning in minutes. If not specified, the default is `60`, which is 60 minutes.
* `percent`: what percentage of the cache will be eliminated each time the cache is eliminated in bulk. You need to specify an integer greater than 0 and less than or equal to 100. A setting of 50 means that half of the cache is eliminated. If not specified, the default is `50`.


::: tip Cache-enabled inspections

Cache-enabled inspections refer to all inspections except CC protection, IP black and white list inspection, and POST inspection.
Cache-enabled inspections refer to all inspections except CC protection, I
P black and white list inspection, and POST inspection.

:::


::: tip Performance optimization suggestions

Too small a `capacity` will result in frequent cache cleanups,
increasing memory fragmentation and reducing performance.
So please set it reasonably according to your actual needs.

:::

Expand Down
10 changes: 8 additions & 2 deletions docs/zh-cn/advance/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ waf_mode STD !UA;
* `duration`:表示超出第一个参数 `rate` 的限制后拉黑 IP 多少分钟(大于零的整数).
* `buffer_size`:用于设置记录 IP 访问次数的内存的大小,如 `10m``10240k`,不得小于 `10m`,如不指定则默认为 `10m`

## `waf_cache_size`
## `waf_cache`

* 配置语法: `waf_cache_size <capacity> [interval] [percent];`
* 配置语法: `waf_cache <capacity> [interval] [percent];`
* 默认配置:——
* 配置段: server

Expand All @@ -118,6 +118,12 @@ waf_mode STD !UA;

:::

::: tip 性能优化建议

`capacity` 过小会导致频繁地淘汰缓存,增加内存碎片,降低性能。所以请根据实际应用场景合理地设置。

:::

::: warning 警告

本配置属于开发版新增的功能,只能在开发版中使用,等稳定后会合并到稳定版中。
Expand Down

0 comments on commit 9d48991

Please sign in to comment.