What a CDN actually does

Cache mechanics

CDN caches obey the same HTTP caching rules as browsers: Cache-Control, ETag, Vary. The key difference is volume — a CDN serves many users from a single cached object, so cache invalidation strategy matters more.

What not to put behind a CDN

!

Cache poisoning. If you treat any unauthenticated request header as part of the cache key, an attacker can craft a request that pollutes the cached response for everyone. Use Vary carefully and only on headers you control.