Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Old content is served from Akamai CDN

Avatar

Level 6

Dear Members,

 

I am using AEMAaCS setup. Facing issue on Akamai CDN. When I publish the page from AEMAaCS author to publish, Akamai is still serving old content. We have disabled fastly CDN as receommended by Adobe through the Header set Surrogate-Control "max-age=0"

 

Content is showing immediately on Adobe publisher environment. 

 

Below is vhost file snippet for the given domain. 

 

<LocationMatch "^/content/.*\.(html)$">
        Header set Cache-Control "max-age=86400"
        Header set Surrogate-Control "max-age=0"
        Header set Age 0
    </LocationMatch>
 
Our requirement is upon page publishing, updated content should show on Akamai CDN domain. 
 
Kindly advise, any help is greatly appreciated. 
 
Thanks,
Pradeep
1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi Folks,

 

This was quite tricky as customer managed CDN has different headers and Adobe managed CDN has different. We are using customer managed CDN Akamai.

 

Akamai has path based cache invalidation API, where multiple path(s) can be passed in API payload. 

Akamai POST API (https://techdocs.akamai.com/purge-cache/reference/invalidate-url) can be invoked through sling event handler upon page publishing.

Since we are not going to write any code so manually cache invalidation is the option we are opting for now.

 

Thanks everyone for posting your valuable thoughts. Appreciated.

 

Thanks,

Pradeep

View solution in original post

5 Replies

Avatar

Community Advisor

@pradeepdubey82 You can try creating a akamai cache invalidation service that can be invoked from within a event handler that listens to a page activation event. The payload in this case is page and the same can be passed to this cache invalidation service.

Avatar

Level 6

Hi Harwinder-singh,

 

We are not planning to write event handler for this. Is there any way to achieve through cache control headers? 

Cache the page for 1 day on CDN, invalidate as soon as page published. 

 

Thanks,

Pradeep

Avatar

Level 6

Hi @pradeepdubey82 ,

You can use postman/curl commands to purge the cache. Here is an article from @Imran__Khan which may help you. Pls check the same .

 

https://javadoubts.com/cloudflare-cdn-purge-cache/

 

Thanks,

Somen

Avatar

Administrator

@pradeepdubey82 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Correct answer by
Level 6

Hi Folks,

 

This was quite tricky as customer managed CDN has different headers and Adobe managed CDN has different. We are using customer managed CDN Akamai.

 

Akamai has path based cache invalidation API, where multiple path(s) can be passed in API payload. 

Akamai POST API (https://techdocs.akamai.com/purge-cache/reference/invalidate-url) can be invoked through sling event handler upon page publishing.

Since we are not going to write any code so manually cache invalidation is the option we are opting for now.

 

Thanks everyone for posting your valuable thoughts. Appreciated.

 

Thanks,

Pradeep