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

AEMaaCS : Dispatcher/CDN cache

  • July 28, 2022
  • 3 replies
  • 4272 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

@tushar_gupta  

@arunpatidar  @lukasz-m  @sachin_arora_ : please give your view on this

arunpatidar
Community Advisor
Community Advisor
August 2, 2022

1> You can do it on CDN itself if you have access otherwise add at dispatcher

2> The file were cached but cache not invalidate when publish again, If you are using adaptive image servlet for rendering assets then you on't have to add png, jepg, jpg in invalidate section but add pdf and other doc in order to get invalidate.

3>If you are using adaptive image servlet for rendering assets then you on't have to add png, jepg, jpg in invalidate section but add pdf and other doc in order to get invalidate. Clientlibs does not invlidate thats why we use version clientlibs. You should not add clientlibs in invalidate part, it will have no effect.

4> You should cache assets as well like html.

5> All file execpt dynamic file which required to hit publisher and OOTB token.json, csrf.json

6> Do we still use dispatcher flush agents in publish for invalidation of cache in AEMaaCS? I think so 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 ? It depends what you want to achieve with cache-control header, please check https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control 

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