Project

General

Profile

Actions

Bug #78596

closed

Deleting a page tree (and causing cache flush by tags) hammers the cache

Added by Claus Due over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2016-11-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Because of the way the cache backend is constructed, flushing the cache by tag name is only possible one tag at a time. This then causes potentially thousands of SQL requests to flush each individual cache. The problem is particularly pronounced in the deletion of page trees because this collects affected page IDs, creates a list of tags - and then iterates this list one by one to flush each cache. It does this twice.

Rather than force consumers to iterate and call to flush each individual cache we can allow passing an array as tag-to-clear. When done this way we can turn the list of tags into a CSV list fitting for an `IN` SQL query which brings the number of SQL queries to flush any number of tags, back down to one (for MySQL; two for other DB backends).

The CacheManager already does not enforce a string value for $tag which means the change is minimal.

The problem exists on 7.6 and master alike. Marked as bug since it impacts performance by more than 10% when deleting a page tree with ~200 pages and related records total; much more so with remote SQL connections.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #86952: flushByTags() is using a all in one , slow mysql commandClosed2018-11-20

Actions
Actions

Also available in: Atom PDF