Entity invalidations in cachetags table are saved if Entity have cache disabled (persistent_cache = FALSE)

Created on 1 June 2021, about 3 years ago
Updated 4 August 2023, 10 months ago

Problem/Motivation

My project have more than 10 million of entities, that have persistent_cache = FALSE property. They are not added to cache_entity table and this is right.

But the problem is that Drupal still save invalidations statistics into cachetags table, as result my cachetags table filled up by millions of unnecessary records, that dramatically slow-down the whole Drupal cache performance.

Steps to reproduce

1. Create the `test1` custom entity with persistent_cache = FALSE property.
2. Create about 1000 entities.
3. Lookup into cache_entity SQL table - you will not see those entities in it.
3. Lookup into cachetags SQL table - you will see 1000 records with tag like test1:123

Proposed resolution

Drupal should check the persistent_cache = FALSE and skip saving statistics to cachetags SQL table.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
CacheΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¦πŸ‡²Armenia Murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
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.

Production build 0.69.0 2024