advanced-alchemy-caching

Installation
SKILL.md

Caching

Execution Workflow

  1. Identify deterministic read paths in repositories or services before adding any caching layer.
  2. Keep query filters and loader options stable so identical reads stay cacheable.
  3. For custom SQLAlchemy types, ensure constructor state is hashable and safe for statement caching.
  4. Use framework-level response caching only for read paths with explicit freshness and invalidation expectations.
  5. Revisit write paths so updates invalidate, bypass, or tolerate stale cached reads.

Implementation Rules

  • Treat caches as derived data, never as the source of truth.
  • Avoid caching reads that depend on implicit session state or nondeterministic defaults.
  • Do not enable cacheable custom types unless their public constructor state is stable and hashable.
  • Separate SQLAlchemy statement caching concerns from HTTP response caching concerns.

Example Pattern

Related skills

More from alti3/litestar-skills

Installs
6
GitHub Stars
5
First Seen
Mar 9, 2026