Provide option to not invalidate the target entity cache when the meta entity is updated

Created on 13 September 2019, about 5 years ago
Updated 5 April 2024, 6 months ago

Currently whenever a meta entity is updated, the cache tags of the target entity are also invalidated. For relevant code see:

  • MetaEntity::getCacheTagsToInvalidate()
  • MetaEntityCacheTagsTest::testTargetEntityCacheClear()

In some use cases this is not desirable. For example we can improve performance by offloading less important but frequently updated metadata to the meta entity, so that the original entity can remain undisturbed.

A good example is the tracking of a view count. With this module we can define a meta entity type for it, and use fast storage (like a Redis -> MongoDB chained backend) to store the data without having to write to SQL storage. Having the meta entity has a lot of advantages over the more traditional approaches, but this would be impossible if the target entity cache tag is invalidated on every view.

It would be great to provide a checkbox in the Meta entity type UI so that the end user can switch this on if desired. It is also trivial for a module developer to perform their own cache invalidation logic by implementing hook_meta_entity_save().

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡¬Bulgaria pfrenssen Sofia

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.71.5 2024