AEMaaCS : Dispatcher/CDN cache | Community
Skip to main content
Level 4
July 28, 2022
Solved

AEMaaCS : Dispatcher/CDN cache

  • July 28, 2022
  • 3 replies
  • 4263 views

Hi,

 

Could you please calrify my below doubts.

1> Where can we configure caching rules for CDN?

2> In dispatcher we have /cache section within which we have /rule section to define which all are the files to be cached and /invalidate section to define which all are files to be considered for invalidating. so my question is , what happens to the files which are part of /rule section but not part of /invalidate section.

3>In our project all most all files are allowed to cache in /rule section but in /invalidate section only .html and mode.json is present . so how will clientlibs and dam assets gets invalidated ?

4> Should we cache assets are not ? what is the standard ?

5> What are must cache files in any aem sites.  

6> Do we still use dispatcher flush agents in publihs for invalidation of cache in AEMaaCS?

7> Do we need to add cache-control to response header with max-age as well to cache files in dispatcher ? /rule section is not enough ?

 

Thanks,

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

1> Where can we configure caching rules for CDN? - 

<LocationMatch "^/content/.*\.(html)$">
     Header set Cache-Control "max-age=200"
     Header set Surrogate-Control "max-age=3600"
     Header set Age 0
</LocationMatch>

these TTL's will be respected by Dispatcher/CDN both

 

2> In dispatcher we have /cache section within which we have /rule section to define which all are the files to be cached and /invalidate section to define which all are files to be considered for invalidating. so my question is , what happens to the files which are part of /rule section but not part of /invalidate section.

they will not cache on dispatcher

https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html?lang=en 

3>In our project all most all files are allowed to cache in /rule section but in /invalidate section only .html and mode.json is present . so how will clientlibs and dam assets gets invalidated ?

it should be on TTL basis.

 

4> Should we cache assets are not ? what is the standard ?

Yes.

5> What are must cache files in any aem sites.  

Assets and try to cache whatever you can.

6> Do we still use dispatcher flush agents in publihs for invalidation of cache in AEMaaCS?

yes

7> Do we need to add cache-control to response header with max-age as well to cache files in dispatcher ? /rule section is not enough ?

max-age is optional.

3 replies

Tushar_GuptaAdobe EmployeeAccepted solution
Adobe Employee
July 28, 2022

1> Where can we configure caching rules for CDN? - 

<LocationMatch "^/content/.*\.(html)$">
     Header set Cache-Control "max-age=200"
     Header set Surrogate-Control "max-age=3600"
     Header set Age 0
</LocationMatch>

these TTL's will be respected by Dispatcher/CDN both

 

2> In dispatcher we have /cache section within which we have /rule section to define which all are the files to be cached and /invalidate section to define which all are files to be considered for invalidating. so my question is , what happens to the files which are part of /rule section but not part of /invalidate section.

they will not cache on dispatcher

https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html?lang=en 

3>In our project all most all files are allowed to cache in /rule section but in /invalidate section only .html and mode.json is present . so how will clientlibs and dam assets gets invalidated ?

it should be on TTL basis.

 

4> Should we cache assets are not ? what is the standard ?

Yes.

5> What are must cache files in any aem sites.  

Assets and try to cache whatever you can.

6> Do we still use dispatcher flush agents in publihs for invalidation of cache in AEMaaCS?

yes

7> Do we need to add cache-control to response header with max-age as well to cache files in dispatcher ? /rule section is not enough ?

max-age is optional.

Level 4
August 2, 2022

Thanks tushar for the reply.I have few questions please answer them
Please find my comments below .

1> I have gone through several documents regarding CDN cache, you are right that surrogate-control can be used for CDN cache, and another way is to add "s-maxage" to cache-control header itself. But in our project we have not added niether of them but still CDN is caching I guess for 5 min, I confirmed this because "x-cache=HIT" was present in the response header. So I think CDN respects even "max-age" of cache-control header as well. So getting confused whether we can continue to use ma-age property itself for both dispatcher and CDN or should I add s-maxage or surrogate-control header please confirm.

2> I think things will get cahced if we just have urls on /rules section , because we dont have assets and clientlibs as part of /invalidate section but /rules section. and they are getting cached.
3>you mean max-age ?

4>Our assets size is around 10-12 GB still ok to cache ?

7>So If we have max-age property defined that means irrespective of whether page is republished or not things gets invalidated and get new copy from server as soon as time mentioned in the max-age is over?

Sachin_Arora_
Community Advisor
Community Advisor
August 3, 2022

2) Those file will remain in cache directory, until cleared manually. /invalidate section is for file that needs to be automatically invalidated when content is updated.

3) Add rules for assets invalidation. Clientlibs follow versioning, so any update in JS/CSS will create new path for a clientlibs.

4) It should be fine until space of cache directory is good enough. I have seen cache of asset heavy as 3-6 GB.

 

7) Yes, if /enableTTL is enabled
https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html?lang=en

 

 

 

 

 

Adobe Employee
July 28, 2022
Himanshu_Jain
Community Advisor
Community Advisor
July 29, 2022