AEMaaCS GraphQL Persisted Queries returning stale Content Fragment data after publish — CDN cache not invalidating
Hi Community,
Sharing a production issue we debugged recently around GraphQL persisted queries and CDN cache invalidation on AEMaaCS. Curious if others have hit this.
The Setup:
- AEMaaCS with Headless delivery using GraphQL persisted queries
- Content Fragments published from Author to Publish
- Persisted queries cached at CDN layer (Fastly via Adobe-managed CDN)
- Cache-Control headers configured via OSGi: GraphQL servlet max-age set to 7200 seconds
The Problem:
After an author publishes a Content Fragment update, the GraphQL persisted query endpoint continues serving stale data for up to 2 hours. The Publish instance returns fresh data immediately if you bypass CDN (hitting Publish IP directly), but CDN-cached responses are not being invalidated on content publish.
What we tried:
- Verified Replication Agent is working — content reaching Publish ✓
- Verified Publish serving fresh data directly ✓
- Cache-Control max-age reducing from 7200 → 300 — helped but didn't solve root cause ✓
- Dispatcher flush rules — not applicable, GraphQL goes directly to Publish on AEMaaCS ✓
What's the correct architecture for cache invalidation of GraphQL persisted queries on AEMaaCS when content changes?