Aem Dispatcher - Delete all cache | Community
Skip to main content
robertol6836527
Level 4
June 9, 2022
Solved

Aem Dispatcher - Delete all cache

  • June 9, 2022
  • 4 replies
  • 2098 views

Good morning,

on Aem I have a web portal with the following structure:

 

- my-project
- my-project/en
- my-project/en/page1
- my-project/en/page1/sub-page1
- my-project/en/page2
- my-project/en/page2/sub-page2

 

how can I remove the cache from the Dispatcher of the whole "web portal" and of the "clientlibs" by calling the "dispatcher / invalidate.cache" interface with the command "curl" ?

 

Thanks

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 JeevanRaj

Hi @robertol6836527 

 

You can use the below curl command to clear the dispatcher cache.

 

curl -H "CQ-Action: Delete" -H "Content-Length: 0"  -H "Content-Type: application/octet-stream"  -H "CQ-Handle: /content/my-project http://localhost/dispatcher/invalidate.cache

curl -H "CQ-Action: Delete" -H "Content-Length: 0"  -H "Content-Type: application/octet-stream"  -H "CQ-Handle: /etc.clientlibs/my-project http://localhost/dispatcher/invalidate.cache

Regards

Jeevan

4 replies

JeevanRaj
Community Advisor
JeevanRajCommunity AdvisorAccepted solution
Community Advisor
June 9, 2022

Hi @robertol6836527 

 

You can use the below curl command to clear the dispatcher cache.

 

curl -H "CQ-Action: Delete" -H "Content-Length: 0"  -H "Content-Type: application/octet-stream"  -H "CQ-Handle: /content/my-project http://localhost/dispatcher/invalidate.cache

curl -H "CQ-Action: Delete" -H "Content-Length: 0"  -H "Content-Type: application/octet-stream"  -H "CQ-Handle: /etc.clientlibs/my-project http://localhost/dispatcher/invalidate.cache

Regards

Jeevan

Himanshu_Jain
Community Advisor
Community Advisor
June 9, 2022
TarunKumar
Community Advisor
Community Advisor
June 9, 2022

Hi @robertol6836527 ,

You can do it through postman. Paste the below CURL command in your curl script box of your postman and it will help.

curl -H "CQ-Action: Delete" -H "Content-Length: 0" -H "Content-Type: application/octet-stream" -H "CQ-Handle: /content/mymyproj" https://<host:port>/dispatcher/invalidate.cache

Level 3
June 9, 2022

You could also check https://adobe-consulting-services.github.io/acs-aem-commons/features/dispatcher-flush-ui/index.html which might be useful for creating a CICD pipeline that cleans cache (we used it when we had no direct connection between CICD pipeline and dispatcher due some project limitations)