Skip to content

Cache: warn on inject() without vary(), and decide how to handle a non-literal <c-cache> key #763

Open

Description

@JuroOravec

Two gaps in how <c-cache> helps authors key a cached render correctly.

  1. inject() without vary(). A cached render that reads a provided value with inject() but does not declare it with vary() stores one value and serves it on later renders, even when the provided value differs. Citry gives no hint. Proposal: warn in development mode. This needs Citry to track which cached render did the reading, which it does not do today.
  2. A key that is not a literal. When the key is an expression, two templates (or two branches) can produce the same key for different bodies. Options:
    • a citry check rule, which adds a code to the public diagnostics list, or
    • adding a fingerprint of the cached body to the key, which changes how keys are shared between templates today.

Needs a decision on (2) before code.

🤖 Generated with Claude Code

Activity

  1. added this to the 1.1.0 milestone on Nov 18, 2026
  2. added
    next-sprint
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    next-sprint

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions