Bug #78596
closedDeleting a page tree (and causing cache flush by tags) hammers the cache
100%
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.