CDN near-mandatory for static, huge for cacheable APIs; wrong cache key or leaked cookie = security incident; invalidation eventually consistent.
Разбор
- Near-mandatory static, huge cacheable HTML/APIs — bad cache key or
Set-Cookie in cached response serves one user's data to another.
- Invalidation eventually consistent. Purge seconds across PoPs; versioned URLs sidestep.
- When NOT: highly personalized per-request — near-zero hit rate, leak risk. Cache shell, personalize client/edge.
- Cost and complexity. Egress pricing, debug stale across PoPs — worth at scale, overkill tiny internal tool.
Итог
CDN trade-off: massive latency win vs cache correctness discipline and invalidation model — personalize carefully.