Problem/Motivation

Views cache plugins configure caching for different types of data, including cached results and rendered output. The effect of cacheSetMaxAge() depends on the cache type. In particular, cacheSetMaxAge('results') controls the max-age of cached query results, whereas cacheSetMaxAge('output') can affect the rendered view’s max-age. The current documentation does not clearly explain this distinction, how cache tags are used, or which cache types are supported.

Steps to reproduce

Proposed resolution

Clarify the documentation in CachePluginBase to explain the distinction between the results and output cache types, document how cache tags are used, and identify the currently supported cache type.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3631718

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

leandro713’s picture

Assigned: Unassigned » leandro713

I’d like to work on clarifying the Views cache plugin behavior in CachePluginBase documentation.

joachim’s picture

Title: CachePluginBase should document the cache functionality of Views cache plugikns » CachePluginBase should document the cache functionality of Views cache plugins

leandro713’s picture

Assigned: leandro713 » Unassigned
Status: Active » Needs review

Clarified the Views cache documentation to distinguish result-cache expiration from the rendered view’s max-age. Also clarified cache-tag usage and the currently supported cache type. The relevant tests, PHP syntax check and PHPCS pass.

ishfaqafridi85’s picture

Status: Needs review » Needs work

One small clarification: Time::getDefaultCacheMaxAge() also uses cacheSetMaxAge('output'). Please make the new comment specific to cacheSetMaxAge('results').

disclosure: tested with the help of an LLM.

leandro713’s picture

Assigned: Unassigned » leandro713

I’ve identified the issue in the comment for cacheSetMaxAge(): it describes the behaviour too broadly, even though getDefaultCacheMaxAge() also calls cacheSetMaxAge('output'), which affects the rendered view’s max-age. I’ll update the documentation to make clear that the statement applies specifically to cacheSetMaxAge('results').

leandro713’s picture

Assigned: leandro713 » Unassigned
Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Lets update the summary with what you're targeting please.

leandro713’s picture

Issue summary: View changes
leandro713’s picture

Hi, I’ve updated the issue summary to clarify the scope of the documentation changes, including the points addressed in the first MR push and the distinction between the results and output cache types. Thanks for the feedback.

leandro713’s picture

Issue summary: View changes
leandro713’s picture

Status: Needs work » Needs review