Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10791

How to avoid multiple cache clearing for one edited record?

We have the problem:
An editor edits a news record, which contains 8 images. The installation is configured to clear cache of 4 pages if a news record is edited. (TCEMAIN.clearCacheCmd = 12,13,14,15)
But instead of one clearance of cache for those 4 pages, each clearance occurs 9 times: one for the news record, and one for each (unchanged) referenced file. These multiple cache clearings take very much time and it even occurs that an error is thrown.

How can we avoid the multiple clearing of the cache for the same pages?
Can we speed up the cache clearance with additional indexes?
Can we use hooks to clear those page caches just one time?

Upvotes: 2

Views: 222

Answers (1)

Benjamin Franzke
Benjamin Franzke

Reputation: 511

Its a known bug [1], that TYPO3 clears cache tags one after another and that this affects performance. That bug applies to your case, as TYPO3 will eventually flush 4 tags (pageId_12, pageId_13, pageId_14 and pageId_15) [2].

There is a not-yet-reviewed patch [3] for TYPO3 7.6 which you could try to backport to TYPO3 6.2.

Site note: Of course it's better to use TCEMAIN.clearCacheCmd = cacheTag:tx_news, if that's applicable in your case (i.e that you didn't want to clear only a subset of pages that contain the news plugin.

[1] https://forge.typo3.org/issues/78596

[2] https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_6-2/typo3/sysext/core/Classes/DataHandling/DataHandler.php#L7344

[3] https://review.typo3.org/#/c/50785/

Upvotes: 1

Related Questions