From a90c0ddd06ed44270a4dfb2f6e540f2a9fa1f7f5 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Thu, 3 Aug 2023 13:53:23 +0800 Subject: [PATCH] docs: add document about how to clean cache --- website/docs/deployment/environment.md | 12 ++++++++++++ .../current/deployment/environment.md | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/website/docs/deployment/environment.md b/website/docs/deployment/environment.md index 38338629432..94f3837f8e3 100644 --- a/website/docs/deployment/environment.md +++ b/website/docs/deployment/environment.md @@ -58,3 +58,15 @@ SMTP_SENDER="\"Tailchat\" example@163.com" # 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 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md index 29dcfde85e4..6e39127ecd5 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md @@ -58,3 +58,15 @@ SMTP_SENDER="\"Tailchat\" example@163.com" # 如果有重复的双引号需要 :::caution 部分环境变量修改可能需要清理缓存后才能生效 ::: + +### 如何清理缓存 + +一些环境变量的改动可能涉及到缓存的更新,如 `FILE_LIMIT`, 因为配置信息是需要发送到客户端的。 + +因此可能会出现修改环境变量后在客户端上的表现还是和以前一样的情况。这时候你需要清空旧的缓存来让更新生效。 + +以下有几种方案可以清理缓存: + +- `docker compose down` 后执行 `docker compose up -d`. 这是因为 `redis` 服务的数据并没有被持久化,把服务关了再重启相当于一个全新的环境 +- 手动进入 `redis` 服务清理名称包含 `config.client` 的缓存项,这里面包含了返回给客户端的配置项 +- 进入 `admin` 管理后台的缓存管理页面。点击`清理配置缓存`按钮