Task #60898

On physically moving a file through the FAL API, the cache of affected pages is not cleared

Added by Lorenz Ulrich almost 7 years ago. Updated over 1 year ago.

Must have
File Abstraction Layer (FAL)
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Sprint Focus:


When a file is moved through the FAL API, the cache of all pages that link that file must be cleared.

Signals that must be used:

  • postFileMove
  • postFileRename
  • postFileReplace
  • postFolderMove
  • postFolderRename

Updated by Gerrit Code Review almost 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32098


Updated by Ingo Schmitt over 6 years ago

  • Category changed from Frontend to File Abstraction Layer (FAL)
  • Sprint Focus set to On Location Sprint

Updated by Philipp Gampe over 6 years ago

The cache must not be cleared automatically, because the file might be used on many pages, even with "insert record" and "show contents of this page", etc. This would be a huge complexity and can potentially kill the server, both for clearing all those caches and for regenerating the caches later on.

Instead, the caching framework should ask the caching framework to clear all cache with the tag sys_file_<uid>:

/** @var CacheManager $cacheManager */
$cacheManager = $this->getCacheManager();
$cacheManager->flushCachesInGroupByTag('pages', 'sys_file_' . $uid);

See \TYPO3\CMS\Core\DataHandling\DataHandler::processClearCacheQueue() [bottom of the function].

The integrator/developer of the site need to make sure to tag all pages that should be cleared automatically. This way he has full control over the performance impact.


Updated by Philipp Gampe over 6 years ago

  • Complexity set to easy

Updated by Lorenz Ulrich over 6 years ago

Comment from Helmut Hummel in Gerrit:

The proposed CacheService works very low level, which is likely to cause troubles when changing internals.
It also works kind of "backwards" by looking at the usages of files in the moment they are changed/moved
Instead I would propose to correctly set cache tags "file_usage_<idOfFile>" for the page once the page is rendered and e.g. publicUrl is called for a file.
When doing so, we can just call ->flushByTag("file_usage_<idOfFile>") when a file is changed

Updated by Mathias Schreiber over 6 years ago

  • Sprint Focus deleted (On Location Sprint)

Updated by Mathias Schreiber over 6 years ago

Results of the discussion at the FAL sprint:
Before we can handle this in a meaningful way the Content Elements need to properly tag the page cache.

If this functionality is in place, we can then clear by tags.


Updated by Mathias Schreiber over 6 years ago

  • Status changed from Under Review to Accepted

Updated by Jigal van Hemert about 6 years ago

  • Priority changed from Should have to Must have

The same effect can be seen by:

- overwriting a file in the Filelist module
- overwriting a file with other methods and running the Scheduler task to update the FAL index

With the pre-FAL behaviour we could explain to editors that placing an image on a page creates a copy of the original image. With FAL this was over and the advantages were clear. Editors wouldn't understand that they would have to manually track down where an image is used and clear caches (an image used in a record would even be more complicated, because it might be necessary to clear the caches of the pages where the record is used).


Updated by DMK E-BUSINESS GmbH over 5 years ago


we got the same problem, hoping for a solution. The bug is accepted but there seems to be no progress since almost one year.

Can a fix still be expected?


Updated by Susanne Moog over 2 years ago

  • Tracker changed from Bug to Task
  • Status changed from Accepted to On Hold

As stated before this can only be fixed after sensible tagging of Content Elements has been introduced.


Updated by Susanne Moog over 1 year ago

  • Status changed from On Hold to Closed

For completenes sake: TYPO3 does not clear caches automatically and will only do so when and if proper caching for all kinds of content is implemented. As that is a long way of and this ticket is a task, I'm going to close this now as the whole topic probably needs an own initiative. (Also because the requirements for different projects might differ a lot, see comments above about insert records for example).

For those needing a more immediate solution to that problem, please take a look at https://extensions.typo3.org/extension/cacheopt which provides the requested feature via hooks as far as I can see.

Also available in: Atom PDF