Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module is awesome! But it's only a very basic API at this point. So here's two very useful contrib integrations.
- Entity Cache integration. When the cache for a specific entity is reset, we also invalidate all
$entity_type => array($entity_id)
tags - A Panels cache plugin that let each pane define it's own tags. Currently this needs to be done in code by each pane implementation. Once we get this in we can patch Panels core entity panes to support them.
The hooks is added to the new cachetags.module
. I've clearly marked in the .info
file that the module is not required to run the Cache Tags cache backend.
These two implementations used in combination will enable extreme granularity and precision in the cache invalidation for entity panes in a panel. Awesome! :)
I added them in the same patch since they are touching the same new files. If required I can split the patch up in two.
Comment | File | Size | Author |
---|---|---|---|
#2 | cachetags-contrib.patch | 7.15 KB | dixon_ |
cachetags-entitycache-panels.patch | 6.11 KB | dixon_ |
Comments
Comment #1
dixon_The patch works very well in our development environment at the moment. So needs review.
Comment #2
dixon_Here is an updated patch that contains bug fixes and new support for invalidating things tagged with nodequeue tags.
This patch comes from my friendly fork of this project. For more up-to-date info, read on that project page.
Peace and love.
Comment #3
DamienMcKennaHow do you handle Views? Do you cache its content lists too or do you just use custom CTools content type plugins & custom invalidation code?
Comment #4
DamienMcKennaAnother thought - references (node references, user references, entity references, etc).
An example: you have an Event content type and a Venue content type with a noderef on the Event content type that points to the Venue, and then we create a Venue node called "Wembley Stadium" and an Event called "Queen @ Live Aid" with the noderef pointing to Wembley Stadium. If the Wembley Stadium node is renamed to "Wembley Stadium, London", shouldn't the "Queen @ Live Aid" node's cache also invalidate?
Comment #5
DamienMcKennaThe next item - Field Collections :) Correct me if I'm wrong, but the patch (and fork) currently don't correctly clear the parent entity when a Field Collection object is saved?
Comment #6
bigjim CreditAttribution: bigjim commented- Maybe I'm missing something but the patch in #2 seems to assume you already have Panels enabled in it's hook_schema implementation. What happens if you enable cache tags before panels?
- Should the plugins folder be namespaced with panels (panels/plugins/cache)? I'm not really a panels dev but this is what I would do with Views plugins.
Comment #7
bigjim CreditAttribution: bigjim commentedOkay I think I'm missing something but for me the cachetags_entitycache_reset() implementation of hook_entiitycache_reset never seems to have a value in the $ids argument, which means the cache_invalidate doesn't do anything. I can run cache_invalidate() by hand, adding the NID by hand, and it works fine.
This stems from the fact that the node_delete_multiple() function doesn't pass any arguments to the resetCache() method of the EntityCacheNodeController class.
Comment #8
mitchell CreditAttribution: mitchell commentedDiff could also use this for #925706: Diff caching.
Changing status from 6 and 7.
Comment #9
mitchell CreditAttribution: mitchell commentedFor instance: entities, revisions, fields, layouts, and views.
Follow-up to #636454: Cache tag support.
May include:
Comment #10
mitchell CreditAttribution: mitchell commentedTags
Comment #11
damiankloip CreditAttribution: damiankloip commentedJust for reference here, we have a views issue related to this: #1712456: How to leverage cache tags in Views
Comment #11.0
mitchell CreditAttribution: mitchell commentedx
Comment #11.1
mitchell CreditAttribution: mitchell commentedx
Comment #11.2
mitchell CreditAttribution: mitchell commentedUpdated issue summary.
Comment #11.3
mitchell CreditAttribution: mitchell commentedUpdated issue summary.
Comment #11.4
mitchell CreditAttribution: mitchell commentedUpdated issue summary.
Comment #12
mitchell CreditAttribution: mitchell commentedThe Cache tag support added change record links to the issues of plugins implementing cache tags, even open ones (like a milestone or meta-issue).
Changed this issue back to its original contrib purpose.
Comment #13
DamienMcKennaI think this should go into a new 7.x-2.x branch.
Comment #14
carlos8f CreditAttribution: carlos8f commentedCache Tags project needs a new maintainer, anyone who wants to take it over, PM me please :)
Comment #15
DamienMcKenna@carlos8f: Between dixon_ and myself I think we have it covered :)
Comment #16
DamienMcKennaI've committed dixon_'s code from his fork to the new 7.x-2.x branch.
Comment #17.0
(not verified) CreditAttribution: commentedUpdated issue summary.