How to handle dispatcher cache for json and images | Community
Skip to main content
maddy_23
Level 2
May 22, 2023
Solved

How to handle dispatcher cache for json and images

  • May 22, 2023
  • 2 replies
  • 2109 views

Hi All,

Can you please suggest best or recommended way to write/manage invalidating dispatcher configuration. We have some JSON services (Content fragments exposed as JSON using sling model). when I publish the content fragment, the changes did not reflects until I manually clear the cache. 

 

For now we have below configuration 

/invalidate
{
                   /0000
                          {
                            /glob "*"
                            /type "deny"
                         }
                   /0001
                         {
                                 /glob "*.html"
                                   /type "allow"
                         }
}

 

Please suggest how I can make it work like if I publish the content fragment, the related cached data get clear from dispatcher. 

Also please suggest if I need to add any configuration for dam images as well.

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 GanthiRa1

Hi @maddy_23 

Instead of completely denying the cache for your JSON by adding dispatcher rules, I would suggest using acs commons dispatcher flush by which you can enable the cache flush in dispatcher at the appropriate path when any changes occur in the content fragment.Please verify it, https://adobe-consulting-services.github.io/acs-aem-commons/features/dispatcher-flush-rules/index.html

 

Hope this helps!

2 replies

Shiv_Prakash_Patel
Community Advisor
Community Advisor
May 23, 2023

Hi @maddy_23 ,

Please try with below invalidation rule

/invalidate
{
/0000
{
/glob "*"
/type "deny"
}
/0001
{
/glob "*.html"
/type "allow"
}
/0002
{
/glob "*.json"
/type "allow"
}
}

Also check similar thread here - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/not-able-to-invalidate-json-in-dispatchers/td-p/164377

We also face cache and invalidation issues with images and their rendition. To overcome this, please check out the below articles.

https://www.linkedin.com/pulse/cacheable-asset-renditions-adobe-experience-manager-mark-daugherty/

https://helpx.adobe.com/in/experience-manager/kb/dispatcher-caching-issue-displaying-image-renditions.html

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/dispatcher-image-caching-issue/m-p/237710

Regards,

Shiv

Shiv Prakash
GanthiRa1Community AdvisorAccepted solution
Community Advisor
May 23, 2023

Hi @maddy_23 

Instead of completely denying the cache for your JSON by adding dispatcher rules, I would suggest using acs commons dispatcher flush by which you can enable the cache flush in dispatcher at the appropriate path when any changes occur in the content fragment.Please verify it, https://adobe-consulting-services.github.io/acs-aem-commons/features/dispatcher-flush-rules/index.html

 

Hope this helps!

September 13, 2023

I don't think this is a right answer because ACS commons dispatcher flush is not compatible with AEM CaaS - as a cloud service. Rethink for correct answer.