\Drupal\Core\Cache\CacheTagsChecksumTrait now contains code that can be easily shared across any classes that want to implement the \Drupal\Core\Cache\CacheTagsChecksumInterface. The implementation handles the details of delayed cache tag invalidations (e.g. a given action should invalidate a number of cache tags, but only at the very end of a transaction).
Contrib cache backend maintainers may want to implement this in order to have the same caching behaviour as core. Depending on the cache backend, that may improve performance and/or fix race conditions. See the related redis issue #3018203: Support delayed cache tag invalidation for an example implementation.
This required changes in the database layer abstraction (to be able to perform certain tasks at the end of transactions). Maintainers of third-party database drivers (core has database drivers for mysql, pgsql and sqlite) m may also want to run the same test coverage, by:
- Creating a subclass of their
Connectionclass thatuses\Drupal\database_statement_monitoring_test\LoggedStatementsTrait— see\Drupal\database_statement_monitoring_test\mysql\Connectionfor an example - subclassing
\Drupal\KernelTests\Core\Cache\EndOfTransactionQueriesTestand overriding only::getDatabaseConnectionInfo, to point to the namespace of their subclassedConnection - The newly created test class should now pass tests :)