# 使缓存失效

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/clion/llms.txt).

当您使缓存失效时，CLion 会删除当前版本 IDE 中曾运行过的所有 项目s 的缓存文件。 下次打开这些项目时，文件将被重新创建。

> **Note:**
> 在继续之前请注意以下几点：
>
>
>
> * 缓存不会被删除，直到您重新启动 CLion。
>
> * 打开和关闭项目而不使缓存无效不会导致删除任何缓存文件。
>
> * [本地历史](local-history.html)不会在您使缓存失效时删除，除非您在 使缓存无效 对话框中明确 [启用此选项](#options)。 但是，请注意，默认情况下本地历史有 5 个工作日的保留期。

Procedure: 清除系统缓存

1. 从主菜单中选择  `文件 | 使缓存无效…` 。

![使缓存失效对话框](https://resources.jetbrains.com/help/img/idea/2026.3/cl_cleancaches_dialog.png)

按 `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `⌘ ⇧ A` (Xcode), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (ReSharper), `⌘ ⇧ A` (ReSharper (macOS)), `Ctrl+Shift+A` (QtCreator), `⌘ ⇧ A` (QtCreator (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS))，开始输入  `使缓存无效` ，然后从列表中选择该操作。

2. 在   使缓存无效   对话框中，您可以选择在删除缓存文件时 IDE 将执行的其他操作：

* 清除文件系统缓存和本地历史记录 ：删除虚拟文件系统缓存以及存储在本地历史中的信息。 此操作对于解决问题可能会有所帮助，当常规的缓存失效不足以解决问题时。

* 清除 VCS 日志缓存和索引 ：移除 VCS 日志的缓存和索引。 如果您确定 VCS 日志索引已损坏，例如日志搜索无法正常工作，请启用此选项。

* 清除远程主机缓存 ：SSH 和 [Docker](clion-toolchains-in-docker.html) 缓存将被标记为无效并随后清除。 在项目重新加载时，这些缓存将再次下载。

* 重置 CMake 缓存 ： [重置 CMake 缓存](cmake-cache.html#reset-cache) 以及 IDE 缓存。

* 删除嵌入式浏览器引擎缓存和 cookies ：移除内置 JCEF 浏览器中存储的缓存文件和 Cookie。 这些文件很少会损坏。 此选项允许您在使缓存失效的同时保留 JCEF cookies 和缓存。

3. 点击   失效并重启  。

如果您点击   仅重启  ，缓存文件将不会被删除，所选的可选操作也不会被应用。

> **Tip:**
> 我们建议您通过   查找操作  重启 IDE：按下 `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `⌘ ⇧ A` (Xcode), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (ReSharper), `⌘ ⇧ A` (ReSharper (macOS)), `Ctrl+Shift+A` (QtCreator), `⌘ ⇧ A` (QtCreator (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS))并输入  `Restart IDE` 。

有关存储各种用户专用文件的更多信息，请参阅 [IDE 使用的目录](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html)。

## See also

### 操作指南

[CMake 缓存](cmake-cache.html) [Docker 工具链](clion-toolchains-in-docker.html)

