stale-while-revalidate vs. a long flat TTL: a Toronto blog keeps freshness
A recipe site set a flat 24-hour TTL to protect a fragile origin. It worked for load — but when they fixed a typo or updated a recipe, Toronto readers saw the old version for up to a day.
Dropping the TTL to 5 minutes fixed freshness and immediately tripled origin load; cache-hit ratio fell from 96% to 71%.
They kept a 5-minute TTL but added stale-while-revalidate=86400. The edge served instantly from cache, refreshed in the background after 5 minutes, and never blocked a reader on origin.
Cache-hit ratio recovered to 95%, and edits propagated within minutes instead of a day.
Long flat TTL wins for truly static assets. SWR wins for content that changes occasionally but must never stall a request.
The number that mattered: 95% hit ratio with 5-minute freshness.
Edge of Glory
@EdgeOfGloryCDN
stale-while-revalidate vs. a long flat TTL: a Toronto blog keeps freshness
Этот пост опубликован в Telegram-канале Edge of Glory. Подписаться можно по ссылке: @EdgeOfGloryCDN.