Experimental project

This is a sandbox project, which contains experimental code for developer use only.

This module may be helpful if you display a list of nodes within another node's page. Examples: embedding a "related news" view on a product page, or a "talks by this speaker" on a speaker page.

In that scenario, Drupal's default caching behaviour is safe but not very performant: all nodes that embed the view are invalidated whenever any node is changed.

We can improve that if we are able to make some assumptions about the view. Instead of the default node_list cache tag that represents everything, we can use something more fine grained.

Features

This module provides a new cache tag that can be used in place of node_list.

For example, where node_list can be described as "the set of all nodes",
the following cache tag means "the set of all nodes whose field_product_reference value is 25":

entity_reference_cache_tag:node:field_products:25

That cache tag works well for views that have a contextual filter based on an entity reference field.
Those views don't need to be invalidated whenever any node changes. They only need to be invalidated when anything that refers to product 25 changes.

This module fits nicely with the views custom cache tags module, which lets you replace the node_list tag with something else.

Post-Installation

TBC

Additional Requirements

There are no other requirements, but note that by itself this module doesn't change anything. It defines new cache tags and takes care of invalidation. You need to make use of them yourself, either in custom code, or with another module, like the views custom cache tags module mentioned above.

Supporting organizations: 
Sponsor my time to work on this

Project information