PhpStorm 2021.1 Help

Invalidate caches

PhpStorm caches a great number of files for all projects that you have even worked with in this IDE version, therefore the system cache may become overloaded. Sometimes the caches will never be needed again, for example, if you work with frequent short-term projects.

When you invalidate the cache, PhpStorm removes the cache files for all project even run in the current version of the IDE. The files will be recreated the next time you open these projects.

Note the following before you proceed:

  • The caches will not be deleted until you restart PhpStorm.

  • Opening and closing a project without invalidating the cache does not result in deleting any files.

  • Local History is not deleted when you invalidate the cache unless you explicitly enable this option in the Invalidate Caches dialog. However, mind that Local History has a retention period of 5 working days by default.

Clear the system cache

  1. From the main menu, select File | Invalidate Caches.

  2. In the Invalidate Caches dialog, you can select additional actions that the IDE will perform while removing the cache files:

    • Clear file system cache and Local History: remove the virtual file system cache together with the information stored in Local History.

      This action might be helpful for troubleshooting purposes when the usual cache invalidation is not enough to solve the problem.

    • Ask before downloading new shared indexes: show a notification prompting you to download new shared indexes as they become available.

      Enabling this option also updates your settings for shared project indexes in Settings/ Preferences | Tools | Shared Indexes.

    • Clear downloaded shared indexes: remove the downloaded shared index files.

  3. Click Invalidate and Restart.

    the Invalidate Cache dialog

    If you click Just restart, cache files won't be deleted, and the selected optional actions won't be applied.

For details on where various user-specific files are stored, see Default IDE directories.

Last modified: 12 August 2021