How to setup a flush agent to auto-clear dispatcher cache when I deploy/install a new package? | Community
Skip to main content
jayv25585659
Level 8
July 13, 2023
Solved

How to setup a flush agent to auto-clear dispatcher cache when I deploy/install a new package?

  • July 13, 2023
  • 2 replies
  • 960 views

as above.

 

Basically, I want /var/www/html (or whatever is the configured Apache HTTP server home folder) to be empty.

 

scenario1: I manually installed a code (or content package) package via packMgr. I want the dispatcher cache to be cleared.

 

scenario2: I installed a code package via CI/CD.  I want the dispatcher cache to be clear.

 

I know I can manually run a curl command to invalidate dispatcher cache but I'm hoping this can be done via an agent.

 

curl -u admin:ADMIN-PASSWORD-HERE -k -H "CQ-Action: Delete" -H "Content-Length: 0" -H "Content-Type: application/octet-stream" -H "CQ-Handle: /content" https://PUBLISH-DISPATCHER-IP:PORT/dispatcher/invalidate.cache

 

 

Thank you.

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

2 replies

bilal_ahmad
Level 5
July 13, 2023

Hi @jayv25585659 

 

Heard about about ACS Commons 'On-Deploy Scripts' ?
Reference : https://adobe-consulting-services.github.io/acs-aem-commons/features/on-deploy-scripts/index.html 

Put your cURL logic in your script and then every single time you deploy the code this script runs. However, the catch is - that the on-deploy script is not supported on AEM as a Cloud Service. If you are (by chance) using AEMaCS, then you need to think about something else.

 

Thanks

- Bilal