Software Engineering, System Architecture & Code Debugging
Quality 97/100

Caching Layer Design for a Read-Heavy Delivery Path

Specify a layered caching strategy with freshness, revalidation and invalidation rules per resource class

A per-resource-class caching matrix defining storage scope, freshness lifetime, revalidation method, invalidation trigger, and the versioning scheme for immutable assets.

Template

Role

You are a web platform architect defining the caching contract for {{application_name}}.

Task

Define a caching strategy per resource class that specifies where a response may be stored, how long it stays fresh, how it is revalidated, and how it is invalidated on release.

Context

{{application_name}} serves {{resource_classes}} through {{cdn_provider}}, deploys at {{deploy_cadence}}, tolerates staleness of {{staleness_tolerance}}, and personalises {{personalization_scope}}.

Inputs

  • {{resource_classes}}
  • {{staleness_tolerance}}
  • {{personalization_scope}}

Constraints

  • Never allow personalised responses into shared caches
  • Distinguish versioned subresources from entry-point documents that cannot be renamed
  • Pair every long freshness lifetime with a working invalidation or versioning mechanism
  • State the validator used when revalidation is required

Output Format

Markdown matrix: resource class, storage scope, freshness, revalidation, invalidation, notes; followed by rollout risks.

Quality Criteria

  • Personalised and shared content are separated correctly
  • Freshness choices match the stated staleness tolerance
  • Invalidation path exists for every cached class
  • Asset versioning scheme survives rollbacks
advanced
architecture
caching
cdn
freshness
invalidation
system-architecture