GraphQL Persisted Query Caching and Invalidation | Community
Skip to main content
Level 2
December 14, 2023
Solved

GraphQL Persisted Query Caching and Invalidation

  • December 14, 2023
  • 2 replies
  • 1985 views

Hi,

 

We are trying to enable caching of the persisted query on the dispatcher by following the instructions on https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/deployment/dispatcher-caching.html?lang=en.

However, even though the dispatcher is on the latest version, the global variable is not recognized when set. Can you please let me know if there is a specific section of the dispatcher where these variables need to be set?

 

The document also says "the Dispatcher adds the suffix .json to all persisted query URLs, so that the result can be cached.", this means the request to the publisher is with .json and should resolve the query, but unfortunately, that does not seem to do the trick. It just cannot resolve when the request is with the suffix .json on the publisher. 

 

Additionally, I would like to know how to invalidate the response cache of a persistent query. Publishing the content fragment doesn't seem to invalidate the cache. I was not able to find an answer to this in the documentation.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Saravanan_Dharmaraj

@nikhilgu1 Please check the below posts for the cache clearing

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/invalidating-cache-of-graphql-persistent-queries/td-p/441238

 

Regarding .json , you need to set .json in the redirect when the calls comes to dispatcher so that dispatcher can cache the result json, otherwise the dispatcher wont cache it 

2 replies

Saravanan_Dharmaraj
Community Advisor
Saravanan_DharmarajCommunity AdvisorAccepted solution
Community Advisor
January 5, 2024

@nikhilgu1 Please check the below posts for the cache clearing

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/invalidating-cache-of-graphql-persistent-queries/td-p/441238

 

Regarding .json , you need to set .json in the redirect when the calls comes to dispatcher so that dispatcher can cache the result json, otherwise the dispatcher wont cache it 

kautuk_sahni
Community Manager
Community Manager
January 8, 2024

@nikhilgu1  Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni