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.
Is there a way/plugin to set a view's cache based on node operations ? meaning if a node of type X is added/updated deleted reset cache.
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedWhile there might be one in contrib that I don't know if, it's relatively easy to write:
Just stick that in a module as per normal Drupal hooks (there's lots of documentation on how to do this if you need help with that).f
Comment #2
redben CreditAttribution: redben commentedThanks merlin, i'm doing it quite the same way. Just wanted to make sure it was not possible from view definition.
PS: Just want to say another thank you for the great module ctools, a time saver ! (especialy the wizard framework!) :-)
Comment #3
redben CreditAttribution: redben commentedIs there any way for invalidating a specific view's only cache ?
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedUnfortunately there is not.
Also, I realize that there might be an error in my original statement. You might need to use cache_clear_all() on the cache_views_data if you are trying to get rid of cached view result/output rather than core views definition data.
Comment #5
redben CreditAttribution: redben commentedThank you for the info merlin