Reputation: 23110
In the TYPO3 backend, I can clear different kinds of cache: frontend caches, general caches, system caches... Furthermore, there are also options to clear caches in the install tools.
In many cases, especially when I develop an extension, I need to clear the caches to reflect the changes I made. However, I never really know which caches I need to clear, and most of the time, I clear each one until I saw the right output when reloading the page. In other cases, when I upgrade TYPO3 for instance, I need to clear the caches from the Install tools, otherwise it looks for php files in the old installation path.
What are the different kind of caches that can be cleared? What is the difference between each of them? Which files or database items each command clears? In which case each clear caches command is necessary (i.e. when modifying which kind of file or information)?
Upvotes: 1
Views: 1985
Reputation: 456
In TYPO3 6.2 and 7:
You can see the configuration of all caches in the backend System > Configuration in the SYS.caching.cacheConfiguration
section. Every cache is registered in one or more "groups": all, system, pages. The menu items reflect these groups:
cacheCmd=pages
): Clears frontend and page-related caches. This makes TYPO3 re-render content which is usually cached (everything except USER_INT objects)cacheCmd=all
): Includes frontend, plus some caches registered by extensions with clearAllCache_additionalTables
(i.e. news cache, realurl caches). Despite being all
it does not include the system caches (and this is why it is called "general caches" and not "all caches" in the menu).cacheCmd=system
): Clears "system-related caches", including the class loader, localization and extension configuration file caches.So best is to get yourself aware what parts of your code are stored in which cache so that you understand what to flush when you change something:
ext_tables.php
, ext_localconf.php
, TCA
are cached in the cache_core => Flush system cache.config.no_cache = 1
.Please note that since TYPO3 8.1 the menu in the backend and the whole system has been simplified, so we only have left:
To ease development without caring about some of these caches, you might want to turn them individually "off".
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pages']['backend'] = NullBackend::class;
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pagesection']['backend'] = NullBackend::class;
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_hash']['backend'] = NullBackend::class;
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['extbase_object']['backend'] = NullBackend::class;
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['extbase_reflection']['backend'] = NullBackend::class;
Upvotes: 9
Reputation: 10791
as noone mentioned the files yet: there are a lot of temporary files which could be removed anytime, and must be removed sometimes. partially they even are included in the cache clearing from the BE.
the base folder is /typo3temp/
caching is done in /typo3temp/Cache/
which is divided in /typo3temp/Cache/Code/
and /typo3temp/Cache/Data/
here are gathered the concatenation of some php-files (e.g. ext_tables.php)
since 7LTS there is another folder which needs manual deletion sometimes: typo3temp/autoload/
where class-information is stored for autoloading. Especially if you develop new extensions this folder is not cleared automatically on each edit.
Upvotes: 0
Reputation: 55798
In very general you need to clear frontend and general caches when changes made in the record (by editing) aren't reflected on page (because page is cached).
system cache additionally keeps different configurations from extensions (all these stuff from ext_tables.php
, ext_localconf.php
, language files, etc.) so you need to clear it when doing changes in these files... but also when injecting for an example new repository to the controllers.
TIP: there's some plugins for the browsers which displays cache clearing icon (a.k.a. Yellow Flash) in the address bar, i.e.: TYPO3 Clear Cache for Chrome
Upvotes: 1