This module is awesome! But it's only a very basic API at this point. So here's two very useful contrib integrations.

  1. Entity Cache integration. When the cache for a specific entity is reset, we also invalidate all $entity_type => array($entity_id) tags
  2. 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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dixon_’s picture

Status: Active » Needs review

The patch works very well in our development environment at the moment. So needs review.

dixon_’s picture

Title: Integration with contrib (entitycache and panels) » Integration with contrib (entitycache, nodequeue and panels)
FileSize
7.15 KB

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.

DamienMcKenna’s picture

How do you handle Views? Do you cache its content lists too or do you just use custom CTools content type plugins & custom invalidation code?

DamienMcKenna’s picture

Another 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?

DamienMcKenna’s picture

The 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?

bigjim’s picture

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

bigjim’s picture

Okay 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.

mitchell’s picture

Title: Integration with contrib (entitycache, nodequeue and panels) » Integration with contrib (entitycache, diff, nodequeue and panels)
Status: Needs review » Needs work

Diff could also use this for #925706: Diff caching.

Changing status from 6 and 7.

mitchell’s picture

Title: Integration with contrib (entitycache, diff, nodequeue and panels) » [meta] Use Cachetags for Plugins
Project: CacheTags (unsupported) » Drupal core
Version: 7.x-1.x-dev » 8.x-dev
Component: Code » cache system
mitchell’s picture

damiankloip’s picture

Just for reference here, we have a views issue related to this: #1712456: How to leverage cache tags in Views

mitchell’s picture

Project: Drupal core » CacheTags (unsupported)
Issue summary: View changes

x

mitchell’s picture

Issue summary: View changes

x

mitchell’s picture

Issue summary: View changes

Updated issue summary.

mitchell’s picture

Issue summary: View changes

Updated issue summary.

mitchell’s picture

Issue summary: View changes

Updated issue summary.

mitchell’s picture

Title: [meta] Use Cachetags for Plugins » Integration with contrib (entitycache, diff, nodequeue and panels)
Version: 8.x-dev » 7.x-1.x-dev
Component: cache system » Code
Issue tags: -Entity system, -revision, -VDC, -Blocks-Layouts, -Plugin system

The 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.

DamienMcKenna’s picture

I think this should go into a new 7.x-2.x branch.

carlos8f’s picture

Cache Tags project needs a new maintainer, anyone who wants to take it over, PM me please :)

DamienMcKenna’s picture

@carlos8f: Between dixon_ and myself I think we have it covered :)

DamienMcKenna’s picture

Status: Needs work » Fixed

I've committed dixon_'s code from his fork to the new 7.x-2.x branch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.