Display or inherit from default tags

Created on 19 April 2020, about 4 years ago
Updated 26 April 2023, about 1 year ago

Many people using this module will want to clear the cache of a view less often.

It's also possible to use the module for the opposite idea - to clear the cache more often. One example of this is a view that is date-sensitive, such as "future events" - see this article. When the day of the event passes it should be removed from the view even though no nodes were saved. Drupal Core doesn't do that or even make it easy (I was reading an issue about it the other day, but can't find it now).

The module works in this case. However I have to work out what cache tags Views would assign by default, recreate that list and add my new tag on the end. In a future version of Views my list may become outdated or wrong. Or I might make a typo and as far as I can see there is no validation. It would be great to have an option so that the custom tag list would be added to the default tags. It would also be useful to display the default tags.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom AdamPS

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.

  • πŸ‡ΊπŸ‡ΈUnited States sclsweb

    I arrived at this issue with a very similar use case to #5 -- a small, low-traffic site with a view displaying a carousel of image fields drawn from 3 content types - events (with a date field that needs to be examined at midnight every night to flush past events out of the view), articles, and slides (which are supposed to stay until removed manually by un-promoting or unpublishing them).

    I have the custom cache tag to remove events from the view when their date passes. The problem is that with the custom tag alone, new article & slide content isn't being added to the view. New events are added immediately for some reason(?), but new articles/slides aren't added until the cache is cleared. Presumably the view also needs whatever original tags a simple view of content provides.

    So, the suggestion in #2 to display the default cache tags in the description would help my use case (because whatever they were, I need to add them back to my view in addition to my time-based custom tag). (Node_list is probably the culprit, but if there is anything more complicated, it would help to have a list of the tags that would have been there before the custom tag was added.)

  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    You can just manually add node_list for your view, or node_list:article and node_list:slide for your specific node types. Again, this is by design.

    If you don't care about invalidating too much, you can also just invalidate node_list and not use this cache plugin at all as mentioned in #6.

  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    And you only need to worry about additional cache tags other than node_list if you have relationships to another entity type and changes there could also affect the view.

Production build 0.69.0 2024