Problem/Motivation

A response assembled from shapes, nested cards, paragraphs, menus and service calls collects cache metadata from a dozen places, and losing a single tag produces the worst kind of bug: a response that is correct when tested and stale in production until a full cache flush. The current resources handle cacheability inconsistently — an earlier review of caching found exactly that — and the new engine multiplies the number of places it can be dropped.

Proposed resolution

  • A test helper that renders a response and asserts its complete cache metadata: tags, contexts and max-age.
  • Per shape, assert that the entities and configuration it reads appear in the tags — a card carries the tags of the referenced entity, a menu block the tags of the menu, a service call whatever the service declared.
  • Assert the contexts of a listing actually cover its query parameters, which is where a wrong page gets served today.
  • Assert invalidation end to end: edit the referenced entity, request again, get the new value.

Remaining tasks

Everything.

Issue fork myrest-3621346

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 fd3637f1 on 1.0.x
    Issue #3621346: Assert the cache metadata of responses built by the...
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)