Expand my Community achievements bar.

SOLVED

Persisted GraphQL query caching max-age issue with AEM on-prem and CDN

Avatar

Level 3

We are using AEM on-prem and have created a persisted GraphQL query on author using cUrl. Following the instructions from this link, we have used "surrogate-control": {"max-age":300} to set the CDN cache at the persisted query level. After replicating it, we have tested the CDN URL of this query and confirmed that the query works well. However, we have noticed that the CDN cache doesn't expire as expected. It gets expired only after about 1 minute, not 300 seconds as we set it, as we check the X-Cache response header. We have tried changing the max-age value, adding "cache-control": { "max-age": 300 }, but the issue persists. Can anyone suggest a solution to this issue?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @wei_lyu ,

 

Might be because the cache is taking place from the default OSGi configuration for publish instances using graphqlCacheControl attribute. Please check-

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...

 

Default values-

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @wei_lyu ,

 

Might be because the cache is taking place from the default OSGi configuration for publish instances using graphqlCacheControl attribute. Please check-

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...

 

Default values-

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...