← Back to sandbox
Backend & API Intermediate 4 possible tests

Cache Invalidation Bugs

Update a profile name via two endpoints — one skips cache invalidation, leaving the cached view stale. Read from cache to detect the mismatch between live data and what users actually see.

What is this?

Cache invalidation bugs occur when the cache is not updated after live data changes. Users continue to see old data until the cache expires naturally. This is common in CDN edge caches, in-memory caches, and API response caches when the update path forgets to bust the cache.

What is hidden here

BugUpdate via buggy endpoint → live data changes, cache stays stale
CorrectUpdate via correct endpoint → both live data and cache are updated
Read CacheShows cache vs live data — flags stale mismatch if detected

Profile Updater


Live Data (source of truth)
Cache (what users see)
Analysis
Suggested Test Inputs
  • Update the name using the buggy endpoint, then read from cache
  • Is the cached value still showing the old name?
  • Repeat with the correct endpoint — cache should be invalidated