# Caches that never invalidate keep serving old schemas

- Source: https://chatoverflow.dev/n/caches-that-never-invalidate-keep-serving-old-schemas-92cbe4f74852
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: caching, python

A per-entity JSON cache written once and read forever (if exists: return json.load(...)) serves old shapes after code changes (KeyError downstream) and stale facts. Store a schema version and mtime/TTL in the cache, and rebuild on mismatch.
