AEMaaCS / EDS - Making cdn.yaml configs scalable | Community
Skip to main content
Level 2
June 16, 2025
Solved

AEMaaCS / EDS - Making cdn.yaml configs scalable

  • June 16, 2025
  • 3 replies
  • 606 views

Hi AEM/EDS experts,

 

We are in the process of migrating AEM pages to the EDS gradually. Until then, we would like to redirect requests either to AEM or EDS at the CDN level using cdn.config based on the URL pattern & it works perfect !

 

However, the cdn.yaml is growing huge as the "matches" pages keep adding. Is there any smart way of handling this problem ? I would have created the cdn.yaml programmatically reading from a list of paths stored somewhere, but I can't do it with the Cloud as the location of cdn.yaml is unknown OR I can't do it vice-versa because I can't really write my program to fetch paths from somewhere. 

 

Pls let me know what you think!

 

Attached, a sample cdn yaml in doc format (as yamls aren't allowed for upload here.) for your reference to check "matches". This is not from the project. Just a default sample one. 

 

Thanks!

 

Best answer by TarunKumar

HI @bsr78033597 ,

One approach I could suggest is that first off, the configs assume that the DEFAULT direction of all traffic will be to your AEMaaCS Dispatcher/Publish stack.
You should not explicitly say “such-and-such traffic goes to AEMaaCS”, you only say what DOESN’T go to AEMaaCS.
Follow below link for more details on it:

https://blog.arborydigital.com/en/blog/config-examples-for-managed-cdn-on-aem-as-a-cloud-service

 

 

-Tarun

3 replies

TarunKumar
Community Advisor
TarunKumarCommunity AdvisorAccepted solution
Community Advisor
June 16, 2025

HI @bsr78033597 ,

One approach I could suggest is that first off, the configs assume that the DEFAULT direction of all traffic will be to your AEMaaCS Dispatcher/Publish stack.
You should not explicitly say “such-and-such traffic goes to AEMaaCS”, you only say what DOESN’T go to AEMaaCS.
Follow below link for more details on it:

https://blog.arborydigital.com/en/blog/config-examples-for-managed-cdn-on-aem-as-a-cloud-service

 

 

-Tarun

ButhpurKiran
Level 4
June 17, 2025

You can simplify the process by externalising the list of paths and generating the cdn.yaml file programmatically. Create a separate, simple file such as a JSON, YAML, or CSV that contains all the paths and their destinations (either AEM or EDS). This file becomes your single source of truth. Next, write a small script  that reads this file and automatically generates the cdn.yaml with the appropriate match rules. For example, the script would loop through each path and insert it into the cdn.yaml under the correct origin. You would run this script locally or as part of your build process before deployment. This way, instead of manually editing the YAML and risking errors or bloating it with repeated entries, you simply update your path list and regenerate the config. If your CDN supports wildcard or regex-based matching, you can reduce the list even further by grouping similar paths under a single pattern, making the config much more manageable. Finally, treat the cdn.yaml as a generated file, make sure not to use one you edit directly, so updates are consistent and controlled. 

Please let me know if a code example can help, Can spin around and create high level steps for you if required.

Kind regards,

Kiran Buthpur

kautuk_sahni
Community Manager
Community Manager
June 26, 2025

@bsr78033597 Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!

Kautuk Sahni