Dispatcher ResourceOnly Flush | Community
Skip to main content
cnur24357457
Level 2
July 16, 2018
Question

Dispatcher ResourceOnly Flush

  • July 16, 2018
  • 3 replies
  • 2074 views

We have a requirement, where we need to invalidate cache of a page when a certain page is published.

Case 1: invalidate cache for /content/en/a when /content/en/a/new is published

Case 2: invalidate cache for /content/en/a when /content/en/b is published

What is the setup required to achieve above scenarios

Thanks

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

3 replies

smacdonald2008
Level 10
July 17, 2018

Here is related AEM docs - Invalidating Cached Pages From AEM

cnur24357457
Level 2
July 17, 2018

I don't see any information here about the Dispatcher ResourceOnly Flush

arunpatidar
Community Advisor
Community Advisor
July 17, 2018

I don't think so you can do mapping from Dispatcher Flush Agent.

But what you can do is create an sling Event Listener which will trigger Dispatcher Flush  programatically for targeted resources as well.

HttpClient client = new HttpClient();

PostMethod post = new PostMethod(agent.getConfiguration().getTransportURI());

post.setRequestHeader("CQ-Action", "DELETE");
post.setRequestHeader("
CQ-Handle", "/");
post.setRequestHeader("
Content-Length", "0");
post.setRequestHeader("
Content-Type", "application/octet-stream");

client.executeMethod(post);

more info.

Invalidating Cached Pages From AEM

Arun Patidar