We've got rid of wildcard cache clears in favour of cache tags. This simplifies the cache backend implementation. However there are some commonly requested cache items that have language variations, and we don't necessarily want the runtime overhead of looking up cache tags for those.
Block plugin definitions is one example, see #1893818: Plugin discovery caches of blocks are not cleared for all languages.
Instead of using cache tags, we could add a helper which takes a root cid, then an array of suffixes to clear it with.
Something like this:
<?php
cache_delete_variations('block_plugins:', array_keys(language_list());
?>
<?php
function cache_delete_variations($cid_prefix, $variations, $bin) {
$cids = array();
foreach ($variations as $variation) {
$cids[] = $cid_prefix . $variation;
}
cache($bin)->deleteMultiple($cids);
}