Preload cache tags in DatabaseBackend::setMultiple()

Created on 8 November 2025, 7 days ago
Updated 9 November 2025, 6 days ago

Problem/Motivation

Same as 📌 Try to preload cache tags in cache getMultiple Active . Since writing to the cache also needs to load the checksum, writing multiple cache items can benefit from the same optimization.

I noticed this in a custom performance test where I'm currently benchmarking 📌 referencedEntities: Use loadMultipleRevisions instead of loadRevision Needs work .

Switching to use the cached getMultipleRevision() and multiple loading in general results in a reduction of queries from 637 to 569, but at the cost of 25 extra cache tag lookups. There are only 4 distinct entity loads for paragraphs (due to nested paragraphs), so that should only be 4 extra grouped cache tag lookups.

I'll also create a companion issue in redis to implement it both getMultiple() and setMultiple() as well.

This only matters if the cache items don't actually exist yet, if they do but have been invalidated through a cache tag, they have already been loaded.

I think there might be some cases in core performance tests where this should show up as well.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Needs review

Version

11.0 🔥

Component

cache system

Created by

🇨🇭Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024