what configs/settings would you set in the CDN vs setting it in the dispatcher?
as an example: I can set caching strategies in both dispatcher and CDN (this is for an AMS setup). But because, changing the CDN requires assistance from the AMS rep, I setup both CDN and dispatcher so that the dispatcher rules takes priority (our team can manage it). I also feel, managing similar configurations in 1 place is better than managing it in 2 places.
suggestions/thoughts?
Thank you.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @jayv25585659 ,
You can use the CDN to cache static files like CSS, JS, and images for a long TTL, and also to handle things like security, geo-routing, and edge logic. The dispatcher is mainly used to cache dynamic pages, handle AEM-specific cache clearing, and control headers and caching time.
Since your team can easily manage the dispatcher, it makes sense to let dispatcher rules take priority. Use Cache-Control headers from the dispatcher to guide the CDN and avoid setting the same rules in both places.
Thanks.
But what about other settings that can be set in both locations?
settings like headers and etc
Views
Replies
Total Likes
When settings like headers, redirects, and security configurations can be set in both the CDN and Dispatcher, it's important to define clear ownership. Let the Dispatcher manage content-related settings like headers and redirects, while the CDN handles performance and security, such as compression and security headers. This avoids conflicts and ensures optimal operation across both layers.
Views
Replies
Total Likes
Hi @jayv25585659 ,
Your instinct is solid, and this is a common challenge in AMS or similar environments where you have limited control over the CDN but full control over the Dispatcher.
General Rule of Thumb: Ownership & Control
Split responsibilities based on who owns what and how frequently things need to change.
Dispatcher (AEM Team-Owned)
Use the Dispatcher to control aspects that:
- Change often
- Are tied to content or site logic
- Require fast iteration by the development team
Typical Dispatcher settings:
- Caching rules for dynamic HTML (short TTL or no TTL)
- Cache invalidation logic tied to AEM publishing
- Headers like Cache-Control, Expires, and X-Dispatcher
- URL rewrites/redirects specific to AEM paths
- Whitelisting paths to avoid caching certain responses
- Security filters (e.g., allowed paths/methods)
CDN (AMS-Owned or 3rd Party)
Use the CDN to handle edge-level concerns that:
- Don't change often
- Improve performance, availability, or security
- Can benefit from global edge presence
Typical CDN responsibilities:
- Caching static assets (e.g., /etc.clientlibs, images, PDFs) with long TTL
- Geo-routing / geo-blocking
- DDoS protection, rate limiting
- TLS/SSL termination
- GZIP/Brotli compression
- Security headers (e.g., Strict-Transport-Security, X-XSS-Protection) – if not set on origin
- Redirects for vanity domains (e.g., example.com → www.example.com)
Strategy Recommendation
- Set cache-control headers in Dispatcher → CDN respects and follows those headers.
- Avoid duplication — don't configure the same logic in both unless there's a fallback reason.
- Document boundaries clearly between Dispatcher/CDN to avoid confusion.
- Use Edge Diagnostics (e.g., curl with -I) to confirm header behavior.
Your setup: Dispatcher has priority
You're right:
- If your team can update Dispatcher without AMS, then set authoritative headers and caching there.
- Let CDN be “dumb”: just forward and cache based on Dispatcher rules. This avoids bottlenecks.
Regards,
Amit Vishwakarma
Views
Replies
Total Likes
Caching strategies in the CDN vs. Dispatcher should be deliberate, and the answer changes depending on your operational needs for control, efficiency, and team agility.
TL;DR: Your approach is sound—set primary caching rules in Dispatcher, keep the CDN config as simple as possible, and rely on standard cache headers. This minimizes the footprint of CDN changes that require AMS intervention, and enables your team to move faster.
“The simplest way is for the origin for AEM and dispatcher to respond with the proper caching headers. And the simplest way to do that is to set these headers in the dispatcher. You can also set them in AEM, but Apache configurations give you a declarative way to do it.”
(Source: Delivering Fast Experiences with Experience Manager Cloud Service)
More:
If you have edge-case needs (e.g., segmentation, geo-restrictions, special WAF rules), those might still need to be configured at the CDN. But for all standard, content-driven caching requirements: → Set at Dispatcher, let CDN follow, and keep your cache-tech debt low.
Views
Replies
Total Likes
Views
Likes
Replies