Skip to content

Block render cache (per-block, version-keyed) #108

@tayebmokni

Description

@tayebmokni

Summary

Per-block server-render cache per doc 07 §15.5 keyed by block:{block_type}:{attrs_hash}:{content_version}. Bumping content_version is the invalidation mechanism (one Redis INCR per relevant content change). Opt-in per block type via the server-render contract (cacheable: true | false | { ttl, version_tags: [...] }). Static blocks (paragraph, heading) cache effectively forever.

Design reference

  • docs/07-media-performance.md §15.5

Acceptance criteria

  • BlockRenderCache interface; Redis-backed implementation
  • Key format: block:{block_type}:{attrs_hash}:{content_version}
  • content_version bumped via INCR on relevant content changes (e.g., post writes bump the global post version)
  • Static blocks (paragraph, heading) cache without content_version (attribute-only)
  • cacheable opt-in declared in server-render contract per block type
  • Cache used by core blocks: core/latest-posts, core/post-list, core/comments
  • Tests verify miss → render → hit → invalidate flow

Dependencies

#fragment-cache

Complexity

M

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions