What is the priority when accessing a file with the same name from different origins on Cloudfront?


Added index.html to origin a,b / path in one distribution.





In this case, it is thought that both are accessed at the same time.

(When connecting to cloudfrontURL.com/index.html, which one of a.s3/index.html OR b.s3/index.html is processed?)

I wonder how cloudfront is handled.

已提问 2 年前2096 查看次数
1 回答

Hi There,

I understand you have uploaded similar named html files into two origins and would like to find out what the priority would be when accessing these files with the same name from different origins on Cloudfront.

Please note: CloudFront Distributions have one to many Behaviors, and there is always one default Behavior. You can have different Behaviors in order of precedence and if in that order of precedence no condition is met, then the default Behavior will take place. With that said, you need to arrange cache behaviors in the order in which you want CloudFront to evaluate them. Since in your case there would be two behaviors that match a given path, CloudFront will break this tie, by precedence ordering between the behaviors, When a request reaches the distribution, CloudFront starts from the top and tries to match the path patterns for each cache behavior. The first one that matches wins therefore with your example, it will depend which one is at the top.

I hope the above information is helpful.

References: [1] https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesPathPattern.

Have a great day ahead.

已回答 2 年前
profile pictureAWS
已审核 2 年前

您未登录。 登录 发布回答。