Caching

Performance

// Definition

Storing the result of an expensive operation (a database query, an API call, a rendered page) so subsequent requests can be served faster without repeating the work. Caching introduces a class of test-specific bugs: stale data shown after an update, cache invalidation failures (old data persists after it should have been evicted), and CDN edge-cache inconsistencies where different users see different versions. Test strategy: verify freshness after writes, verify cache is bypassed when it should be (e.g. authenticated vs. public), and test behaviour when the cache layer is cold or unavailable.

// Related terms