Problem/Motivation

Thirty resource plugins return a ResourceResponse, but cacheability metadata is applied inconsistently. Responses that omit cache tags and contexts are either never cached or, worse, cached and served stale after content edits.

Proposed resolution

  • Attach CacheableMetadata with entity cache tags, list cache tags, and the relevant contexts (url.query_args, languages:language_content, user.permissions) to every response.
  • Add a helper in MyrestResourceBase so each plugin collects metadata uniformly.
  • Add kernel tests asserting the tags on representative endpoints.

Remaining tasks

Audit all resource plugins and add the missing metadata.

User interface changes

None.

API changes

Responses expose accurate cache headers.

Issue fork myrest-3615456

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

sergeydruua created an issue. See original summary.

  • sergeydruua committed 5216484c on 1.0.x
    Issue #3615456: Add complete cacheability metadata to all REST resources
    
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)