Invalidation is not happening while triggerring the flush request for custom servlet through code
We have cached country specific custom servlets(e.g /bin/myproject/servlet/us/en/myservlet.json) at the dispatcher in JSON format. When a XF is replicated, we need to clear cached JSON files for all countries. So we are triggering resource-only-flush request for /bin/myproject/servlet.
From Publish logs, could confirm that the flush request is successful.
com.day.cq.replication.Agent.resource-only-flush ------------------------------------------------
com.day.cq.replication.Agent.resource-only-flush Sending message to dispatcher:8080
com.day.cq.replication.Agent.resource-only-flush >> POST /dispatcher/invalidate.cache HTTP/1.0
com.day.cq.replication.Agent.resource-only-flush >> CQ-Action: Activate
com.day.cq.replication.Agent.resource-only-flush >> CQ-Handle: /bin/myproject/servlet
com.day.cq.replication.Agent.resource-only-flush >> CQ-Path: /bin/myproject/servlet
com.day.cq.replication.Agent.resource-only-flush >> CQ-Action-Scope: ResourceOnly
com.day.cq.replication.Agent.resource-only-flush >> Referer: about:blank
com.day.cq.replication.Agent.resource-only-flush >> Content-Length: 0
com.day.cq.replication.Agent.resource-only-flush >> Content-Type: application/octet-stream
com.day.cq.replication.Agent.resource-only-flush --
com.day.cq.replication.Agent.resource-only-flush << HTTP/1.1 200 OK
com.day.cq.replication.Agent.resource-only-flush << Date: Fri, 01 Mar 2024 10:10:10 GMT
com.day.cq.replication.Agent.resource-only-flush << Server: Apache/2.4.20 (Unix) OpenSSL/1.0.2h Communique/4.1.12
com.day.cq.replication.Agent.resource-only-flush << Cache-Control: max-age=0
com.day.cq.replication.Agent.resource-only-flush << Expires: Fri, 01 Mar 2024 10:10:10 GMT
com.day.cq.replication.Agent.resource-only-flush << Vary: User-Agent
com.day.cq.replication.Agent.resource-only-flush << Content-Length: 13
com.day.cq.replication.Agent.resource-only-flush << Content-Type: text/html; charset=utf-8
com.day.cq.replication.Agent.resource-only-flush <<
com.day.cq.replication.Agent.resource-only-flush <<
com.day.cq.replication.Agent.resource-only-flush Message sent.
com.day.cq.replication.Agent.resource-only-flush ------------------------------------------------
com.day.cq.replication.Agent.resource-only-flush Replication (ACTIVATE) of /bin/myproject/servlet successful.
Also from dispatcher logs, could confirm that the invalidation request is received
[Fri Mar 01 11:10:10 2024] [D] [75912] checking [/dispatcher/invalidate.cache]
[Fri Mar 01 11:10:10 2024] [I] [75912] Activation detected: action=Activate [/bin/myproject/servlet]
[Fri Mar 01 11:10:10 2024] [D] [75912] response.status = 200
[Fri Mar 01 11:10:10 2024] [D] [75912] response.headers[Server] = "Communique/2.6.3 (build 5221)"
[Fri Mar 01 11:10:10 2024] [D] [75912] response.headers[Content-Type] = "text/html"
[Fri Mar 01 11:10:10 2024] [D] [75912] cache flushed
But the servlet folder /bin/myproject/servlet is not cleared at Dispatcher cache location.
Any suggestions on what is missing here?