Skip to content

Commit

Permalink
docs: add document about how to clean cache
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Aug 3, 2023
1 parent 3c4df73 commit a90c0dd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions website/docs/deployment/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,15 @@ SMTP_SENDER="\"Tailchat\" [email protected]" # If there are repeated double quotes
:::caution
Some environment variable modifications may need to clear the cache to take effect
:::

### How to clear the cache

Changes to some environment variables may involve cache updates, such as `FILE_LIMIT`, because config data needs to be sent to the client.

Therefore, it may appear that after modifying the environment variable, the performance on the client is still the same as before. At this point you need to clear the old cache for the update to take effect.

There are several options for clearing the cache:

- Execute `docker compose down` then run `docker compose up -d`. This is because the data of the `redis` service is not persisted, shutting down and restarting the service is equivalent to a brand new environment
- Manually enter the `redis` service to clean up the cache items whose name contains `config.client`, which contains the configuration items returned to the client
- Enter the cache management page of the `admin` management system. Click the `Clean Configuration Cache` button
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,15 @@ SMTP_SENDER="\"Tailchat\" [email protected]" # 如果有重复的双引号需要
:::caution
部分环境变量修改可能需要清理缓存后才能生效
:::

### 如何清理缓存

一些环境变量的改动可能涉及到缓存的更新,如 `FILE_LIMIT`, 因为配置信息是需要发送到客户端的。

因此可能会出现修改环境变量后在客户端上的表现还是和以前一样的情况。这时候你需要清空旧的缓存来让更新生效。

以下有几种方案可以清理缓存:

- `docker compose down` 后执行 `docker compose up -d`. 这是因为 `redis` 服务的数据并没有被持久化,把服务关了再重启相当于一个全新的环境
- 手动进入 `redis` 服务清理名称包含 `config.client` 的缓存项,这里面包含了返回给客户端的配置项
- 进入 `admin` 管理后台的缓存管理页面。点击`清理配置缓存`按钮

0 comments on commit a90c0dd

Please sign in to comment.