012024
A cache key collision quietly served the wrong product page for hours.
- Context
- Headless WooCommerce storefront with edge caching keyed by product slug. Two products in different categories ended up with overlapping cache keys after a slug normalization change.
- What happened
- For a window of about four hours, a small percentage of visitors saw the wrong product detail page. The site looked healthy — no 500s, no error spike — until a customer support ticket surfaced it.
- What I missed
- I trusted the slug as a unique cache key without re-deriving uniqueness after the normalization change. The test suite didn't cover cache-layer behavior, only the response shape.
- What changed
- I now treat cache keys as a first-class part of any data-shape change. The repo got a small integration test that hits the cache layer with adjacent product IDs and asserts response identity. PR template now has a "Does this change anything cache-keyed?" line.
