The underappreciated power of content invalidation

Some say there are only two hard things in computer science: cache invalidation and naming things. The latter is a matter of personal taste, but keeping things up to date is an aspect many of us have to deal with on daily basis.

This is particularly important from content delivery standpoint. Whenever you log into AEM to activate your carefully crafted pages the expectations are rather straightforward - you want that to be delivered fast, regardless of user’s location or device type. This is where Content Delivery Network (CDN) comes into play.
AEM with CDN is a fairly common thing these days. The most basic implementation assumes that only static resources get cached - DAM assets, clientlibs and possibly pages that don’t change very often. You set a reasonably short TTL and call it a day. But what if that’s not enough? What if you don’t want to sacrifice dynamic content and keep objects cached as long as there was no update in AEM?

We decided to give “everything is cacheable” principle a try in a complex multi-AEM setup. It didn’t took us long to realize that content invalidation is as important or even more important than caching itself. You can treat it rough, but it will negatively impact user experience - neither authors nor users want to wait when change is required now.