---
title: "Clearing the cache"
manual: "External Import"
version: "main"
permalink: "https://docs.typo3.org/permalink/cobweb/external_import:user-clear-cache@main"
source: "User/Cache/Index.rst"
rendered: "2026-10-17T19:10:20+00:00"
---

# Clearing the cache {#user-clear-cache}

When data is imported into your TYPO3 CMS installation, you may want to
clear the cache for a number of pages in order for the new data to be
displayed as soon as it is available. One way to achieve this is to
rely purely on TYPO3 CMS and use the [TSconfig property](https://docs.typo3.org/m/typo3/reference-typoscript/14.3/en-us/PageTsconfig/TceMain.html#pagetcemain-clearcachecmd):

```typoscript
TCEMAIN.clearCacheCmd = xx,yy
```

on the page(s) where the data is stored to automatically trigger the
clearing of the cache for the given pages (xx and yy) when any record
they contain is modified or deleted, or some new record inserted.

This works fine but has one big drawback: it is triggered for
**each** record. If you manipulate a lot of records, the cache
clearing may be called hundreds or thousands of times. This can be
very bad for your site, especially if you have a very large cache.

It is also possible to trigger the
clearing of the cache **after** the whole import process has
completed for a given configuration. Instead of using TSconfig, the
configuration would be something like:

```php
$GLOBALS['TCA']['tx_news_domain_model_news']['external']['general']['0']['clearCache'] = 'xx,yy';
```

This will clear the cache for pages "xx" and "yy", but only after all
records have been inserted, updated and deleted. The process still
relies on DataHandler for clearing the cache of each page, so you may rely
on the usual clear cache hooks if needed.

Besides page numbers, you can also use more general cache identifiers
like "pages" (to clear the cache for all pages), cache tags, or any
other value that can be used with
[TCEMAIN.clearCacheCmd](https://docs.typo3.org/m/typo3/reference-typoscript/14.3/en-us/PageTsconfig/TceMain.html#pagetcemain-clearcachecmd).
