Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Aem Dispatcher - Delete all cache

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 3

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

Avatar

Level 3

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)