As per our requirements we are caching the pages in dispatcher like this format ex :- /content/eacom0/en_us/help/Sam_Test_Availability_Alpha_Beta_Demo/jcr:content.-1.json .
The problem here is I am not able to invalidating the jcr:content.-1.json by using the dispatcher configurations.
Any suggestions or solutions for this.
Thanks In Advance. :)
Have you read all of the AEM documentation:
https://docs.adobe.com/docs/en/dispatcher/page-invalidate.html
Views
Replies
Total Likes
I have tried everything except the sling Servlet.
Does there any way to handle via the configurations instead of the servlet. ?
Views
Replies
Total Likes
What do you mean with "I am not able to invalidate ..."? What have you tried? Can you set the dispatcher on loglevel DEBUG and post the relevant logs then?
Kind regards,
Jörg
We are caching the pages using JSON format like this /jcr:content.-1.json .
After publishing of the page , we are able to cache dispatcher but when we do modifications and reactivated the page it suppose to clean that cache at the time of reactivation (by using the triggers in publisher agents).
But what is happening its not invalidating/clearing the cached JSON in dispatcher , The result is we are unable to get the latest changes . We always getting the first one.
With same configurations We are able to invalidate the .html in dispatcher after the reactivation of the pages.
I hope you understand the situation :)
Views
Replies
Total Likes
Can you share the /invalidate section of your dispatcher.any configuration and the dispatcher log entries...
Views
Replies
Total Likes
Here is my invalidation configuration in dispatcher.
/invalidate
{
/0000
{
/glob "*"
/type "deny"
}
/0001
{
# Consider all HTML files stale after an activation.
/glob "*.html"
/type "allow"
}
/0002
{
/glob "/etc/segmentation.segment.js"
/type "allow"
}
/0003
{
/glob "*/jcr:content/.-1.json"
/type "allow"
}
}
Views
Replies
Total Likes
Please replace the "/jcr:content/.1.json" with ".json".
Views
Replies
Total Likes
Hi Jorg,
I tried that one. It got failed.
Views
Replies
Total Likes
Actually, JSON caching isn't done the way you have http request. Just clarify this is your request..*/jcr:content/.-1.json but caching folder is _jcr_content
So, just try URL like this in invalidating section. One more thing, Just guessing that Dot could be an issue but not sure. it is symbol for hidden files.
/0003
{
/glob "*/_jcr_content/.-1.json"
/type "allow"
}
--Jitendra
Views
Replies
Total Likes
Let me try this option.
Views
Replies
Total Likes
I am able to clear the cache by using the post call. Thanks everyone.
Views
Replies
Total Likes
Views
Replies
Total Likes
I am able to solve this problem with use of POST servlet .
HttpClient client = new HttpClient();
PostMethod post = new PostMethod("http://"+host+uri);
// post.addRequestHeader("Content-Type", "application/json");
post.setRequestHeader("CQ-Action", "Activate");
post.setRequestHeader("CQ-Handle",handle);
StringRequestEntity body = new StringRequestEntity(page,null,null);
post.setRequestEntity(body);
post.setRequestHeader("Content-length", String.valueOf(body.getContentLength()));
client.executeMethod(post);
post.releaseConnection();
Views
Replies
Total Likes
Views
Likes
Replies