AEM Dispatcher caching for personalised experiences

CIRCUIT’s two-day Chicago conference brought Java developers, AEM architects, front-end engineers and systems specialists together around Adobe Experience Manager. Its 2015 and 2016 session archives remain useful for balancing delivery speed with content control, from publish replication and microservices to analytics-driven experiences.

AEM Dispatcher caching is where that balance becomes concrete. A shared cache can absorb traffic and protect the origin, yet the same cache can expose one customer’s content to another or serve stale inventory. Cookie-aware rules, careful cache keys and explicit boundaries between shared and private responses are the core of a safe personalisation strategy.

Australian audiences add practical constraints. Sydney, Melbourne, Brisbane and Perth have different paths to a central origin, while mobile shopping and banking during commutes make fast delivery routine. Local banks, retailers and travel businesses operate across AEM, apps and partner sites, so one delivery rule rarely fits every channel.

How the cache layers change a request

A typical journey may pass through a browser cache, a CDN, the Apache Dispatcher reverse proxy and an AEM publish tier. Each layer can reduce work, but each also changes how fresh, personalised or sensitive the response may be.

Request type Recommended caching Key decision Personalisation boundary
Anonymous content Shared edge and Dispatcher cache Normalise URLs and use a bounded TTL Adapt after retrieval or use non-sensitive segments
Signed-in content Private or no shared caching Separate authenticated route Generate for the current user only
Mixed shell and widgets Cache shell; fetch widget separately Split APIs from page documents Keep user data outside shared HTML
Consent-dependent content Short shared TTL when context is coarse Explicit allowlist of relevant cookies or headers Suppress the variant until consent is known

Dispatcher is suited to shared content, static assets and repeatable anonymous pages. Cache-control headers, Dispatcher rules and replication invalidation determine what can be reused. Neither the browser nor CDN should compensate for weak origin policy by guessing which variant a visitor needs.

Shared caching works best when the response is independent of the person. Signed-in pages, basket summaries and account banners belong outside a shared cache. Splitting a page into a cacheable shell and separately fetched personalised component often creates a better boundary than caching the entire document.

Keep personalised responses out of shared caches

Personalisation should happen at the narrowest reliable boundary. Anonymous visitors can receive cached content adapted later in the browser or through a separate authorised call; signed-in responses should use a private route or bypass shared Dispatcher and CDN caches. This keeps email addresses, baskets and recommendation histories out of reusable HTML.

If a CDN supports edge-side includes, it can combine a cached shell with a short-lived personalised fragment. Keys must remain bounded and must not expose personal information in a URL. A loyalty tier may suit deliberate edge composition better than a session identifier, but only where consent, security and cache-cardinality limits are understood.

Custom signals can guide delivery, but their role must be explicit. The custom action eventing approach discussed at CIRCUIT shows how domain actions can trigger downstream behaviour. Use catalogue or preference events to invalidate relevant content, not to place raw customer data in shared cache keys.

Make cache decisions cookie-aware

Cookie awareness starts with classification. Separate cookies establishing authentication, carrying a deliberate preference, or used only for measurement. Analytics cookies should not change the shared key; authentication cookies usually indicate a private response. A broad Vary: Cookie rule multiplies variants for every cookie combination and fills the cache with entries nobody reuses.

Allowlist only cookies or headers that genuinely select a variant. Return Cache-Control: private, no-store for authenticated or sensitive responses, and use short lifetimes for consent-dependent content. Cover logout, consent withdrawal and preference changes, or an old personalised fragment can survive in a browser or intermediary cache.

Australia’s Privacy Act 1988 and Australian Privacy Principles govern personal information collected through these experiences. There is no universal cookie-consent rule equivalent to the EU’s GDPR, but a cookie identifying a person or recording activity still needs a defensible purpose, notice and appropriate handling. For a Melbourne commuter opening an account offer on a train, the distinction is whether the response depends on identifiable information, not merely whether a cookie exists.

Design an Australian edge and origin strategy

Cache placement should reflect population centres rather than one default location. An origin concentrated in Sydney can make a Melbourne shopper wait on a long round trip, while Brisbane or Perth experiences a different balance of latency and load. Distribute publish capacity where useful, place CDN points of presence close to users, and replicate asynchronously so edges do not depend on a synchronous journey to the origin.

Use longer lifetimes for stable editorial pages and short lifetimes for prices, stock, flights and disruption notices. Reserve bypass rules for authenticated or regulated content. Australian banks and major retailers need careful handling because a harmless-looking banner may reveal an account state, while a cached promotion can contradict current campaign terms and create Australian Consumer Law exposure.

Test failover as part of caching. If a publish region is unavailable, can the CDN serve bounded stale content without exposing private data? Are purge requests idempotent? Does failed invalidation leave old content indefinitely? A policy that saves milliseconds normally but magnifies an outage is not resilient.

Invalidate deliberately when content changes

Invalidation should be proportional. A targeted purge beats flushing a broad Dispatcher path when only one campaign changes, while emergency content may justify a wider flush. Set maximum ages as a safety net, record why content was purged, and restrict the invalidation endpoint so it cannot create a denial-of-service path.

Event-driven invalidation can connect a publishing action to relevant cache objects, but the event should identify content scope rather than announce that something changed. Acknowledge success only after required publish and purge steps succeed. If a purge fails, alert the content owner and keep the fallback expiry short enough to limit exposure.

A migration is another reason to test assumptions. Before moving from AEM 6.0 to 6.5, the AEM 6.5 upgrade guide provides a checkpoint for reviewing publish topology, Dispatcher configuration and invalidation behaviour. Rehearse purge and rollback paths against the target environment instead of carrying old rules forward unchanged.

Test cache behaviour under real conditions

Build a test matrix around delivery state, not just URL. Cover anonymous and signed-in visits, consent withheld and granted, a changed preference, logout and a republished page. Assert cache status, headers and content, then repeat the sequence; single-request tests can miss a stale variant retained from an earlier state.

Measure from Australian mobile and fixed-line paths with synthetic probes during busy retail periods. Record cache-hit ratio, origin latency, stale-response rate and personalised-component render time in aggregate. Logs should capture rule names and non-sensitive identifiers, not raw cookie values, names, email addresses or basket contents. Link cache hits to business events such as completed applications, not just page views.

Resilience tests should include region loss, delayed purge, malformed cache-control headers and an unavailable personalisation service. The ISORC 2015 programme offers a parallel for reasoning about distributed failure, timing and safe degradation. Desired behaviour is explicit: serve shared content when permitted, suppress private data and expose degradation to operators.

Roll out a policy teams can operate

Begin with an inventory labelling each AEM experience shared, personalised or mixed. Define ownership for Dispatcher rules, CDN configuration, consent handling and invalidation, and store decisions in a version-controlled runbook. Monitor rules after every release because a front-end change can alter cookies, headers or response composition without touching cache configuration.

Start now: select one high-traffic Australian customer journey, document its anonymous, signed-in and consent states, and measure cache-hit ratio, stale rate and render time from the priority cities. Use the CIRCUIT session recordings to revisit the underlying architecture, then publish the agreed policy, owner and alert thresholds to the delivery team.