FileEntity::getCacheTags breaks invalidation via Cache Tags

Created on 28 November 2016, over 7 years ago
Updated 18 January 2024, 5 months ago

Problem/Motivation

FileEntity::getCacheTags returns an empty array. This breaks the cache invalidation for File entities in Views for example.

IRC log

<webflo> berdir: http://cgit.drupalcode.org/file_entity/tree/src/Entity/FileEntity.php#n500 i think FileEntity:: getCacheTags returns no cache tag. i think this breaks tag-based cache invalidation in views. 

<webflo> i use field based rendering in views, no rendered entity 

<berdir> webflo: hm, yes, that is possible...

<berdir> webflo: tricky. that optimization is quite important for us/anyone who has lots and lots of files on overview pages. maybe we could make it configurable? but then you still have to know that you have to change that settings

<berdir> webflo: maybe we can somehow apply the logic from \Drupal\file_entity\Entity\FileEntityViewBuilder to it?

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany webflo

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.

  • πŸ‡§πŸ‡¬Bulgaria vflirt

    I have stumbuled on this issue as we have some code that does not properly populate the file_usage table which results in cache not being cleared. I am updating the patch for latest dev.

Production build 0.69.0 2024