A studio reported its CDN invoice doubling in six weeks with no traffic growth. The cause was a cache key change made during a security review: the key included a session identifier, so every viewer request became a unique object and the cache hit ratio fell from 94 percent to 11 percent.
The arithmetic is unforgiving. At 20 million requests a month, a 94 percent hit ratio means 1.2 million requests reach the origin. At 11 percent, 17.8 million do. If the origin charges per request and the edge charges per gigabyte, both lines rise even though the audience is identical.
The five settings that eat a budget
Session or user identifiers in the cache key. Cookies forwarded to the origin by default. Query strings preserved in the key, including campaign parameters. Image resizing done at request time rather than at upload. And a preview or thumbnail tier that is not cached separately from the main asset.
The fix took an afternoon: strip the session identifier from the key, normalise campaign parameters, and serve thumbnails from a separate cached path. The invoice returned to roughly its previous level in the following cycle, which is the only proof that matters.
The monitoring lesson is simpler. A hit-ratio alert at 80 percent would have caught this on day two. Most studios monitor uptime and error rate and treat cache efficiency as an implementation detail until the bill arrives.
Key takeaways
- A session identifier in the cache key dropped a hit ratio from 94 to 11 percent.
- At 20 million requests a month, that change moved 16.6 million requests to the origin.
- Alerting on cache hit ratio catches this in days instead of at invoice time.