Hi All,
As part of flushing referenced pages, we have to call flush agent programmatically to flush each referenced page for scaffolding content.
Scaffolding content is added in different pages and cache invalidation has to be happen for all referenced pages whenever scaffolding content page has to replicated from author to publish.
I tried the below API to call flush agent similar to calling normal replication agent for publishing content from author to publish. It is invoking flush agent.
ReplicationOptions opts = new ReplicationOptions();
opts.setSuppressVersions(true);
opts.setSuppressStatusUpdate(true);
AgentIdFilter agentIdFilter = new AgentIdFilter("flush");
opts.setFilter(agentIdFilter);
replicator.replicate(session, ReplicationActionType.ACTIVATE, action.getPath(), opts);
Not sure whether it is proper way to do it ? Is there any other way to call flush agent programmatically ?
I don't want to flush each page by using CURL or PostMethod method call.
PostMethod post = new PostMethod("http://localhost:80/dispatcher/invalidate.cache");
post.setRequestHeader("CQ-Action", "Activate");
post.setRequestHeader("CQ-Handle",handle);
Solved! Go to Solution.
Views
Replies
Total Likes
If the paths to be flushed are already known, there is another configuration based approach for flushing cache using ACS Commons Dispatcher Flush Rules. This could be a better option than deploying code/bundle for flushing cache, otherwise you could extend this API to build a custom solution.
Alternatively, you could build a custom configuration-based solution via shell scripts/apache modules based on complexities involved in use case considering all other aspects.
Views
Replies
Total Likes
If the paths to be flushed are already known, there is another configuration based approach for flushing cache using ACS Commons Dispatcher Flush Rules. This could be a better option than deploying code/bundle for flushing cache, otherwise you could extend this API to build a custom solution.
Alternatively, you could build a custom configuration-based solution via shell scripts/apache modules based on complexities involved in use case considering all other aspects.
Views
Replies
Total Likes
Hi Gaurav. Thanks for your inputs. I want to know how to invoke flush agents from Java similar like normal replication agents.
Views
Replies
Total Likes
Follow the source code of DispatcherFlusherImpl.java -
Couple of old blogs for reference:
Views
Likes
Replies
Views
Like
Replies