Expand my Community achievements bar.

SOLVED

how to implement automated akaimai cache clearing process on replication/publishing a page/multiple pages for multi-domain environment setup in AMS(6.5.x)

Avatar

Level 2

we support multi-domain web sites in the project and trying to create a automated process to clear the cache from akamai when a page published/replicated. we have AMS environment  with AEM 6.5.x and will be using Akamai purge rest api.  what are the steps we do on the AEM side. I was trying to follow this approach
""create an event handler and listen to replication type and send the post request to akamai purge rest api""

with this process I see some concerns as below

a. how do I find out the domain names for the pages to send it to akaimai api

b. whenever we publish a page with assets as part of it, it will trigger multiple  requests to akamai.  I wanted to make it as single request to the page specific resource to clear the cache.

c. will this supports the  tree activation? if yes,  will the akamai servers can handle multiple requests. 

d. do we need to  add the logic to configure proxy in the code

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

You can handle by implementing preprocessor and add the urls to a node and using scheduler which can run every min/5min based on your requirement call the Akamai API purge and send cache clear requests in batches. 

 

You can add the domain names to the parent node , using inheritance read the domain name based on the path.

 

Yes, Akamai support multiple urls upto around 50 urls in one request.

 

@component(service = Preprocessor.class, immediate = true)

public class PreActivateListener implements Preprocessor {

 

@Override

public void preprocess(ReplicationAction arg0, ReplicationOptions arg1) throws ReplicationException {

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi,

 

You can handle by implementing preprocessor and add the urls to a node and using scheduler which can run every min/5min based on your requirement call the Akamai API purge and send cache clear requests in batches. 

 

You can add the domain names to the parent node , using inheritance read the domain name based on the path.

 

Yes, Akamai support multiple urls upto around 50 urls in one request.

 

@component(service = Preprocessor.class, immediate = true)

public class PreActivateListener implements Preprocessor {

 

@Override

public void preprocess(ReplicationAction arg0, ReplicationOptions arg1) throws ReplicationException {

Avatar

Community Advisor

You can explore Adobe IO option if using Cloud Manager.

This is bascially an event driven framework, which calls api based on some event,

so in your case you can call CDN cache invalidation on publish event.

 

https://developer.adobe.com/runtime/docs/guides/



Arun Patidar

Avatar

Level 4

Hi @rajashekharreddy0707 ,

Curious to know how did you implement the aem akamai purge integration.
How did you ensure dispatcher cache is flushed before a single akamai purge request is issued. 
From which environment and on which event are you making the akamai purge request. 
Did you face any challenges during tree-activation. 

Thanks