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

0

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

=============

a.s3/index.html

b.s3/index.html

=============

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.

joker
已提问 2 年前1981 查看次数
1 回答
0
已接受的回答

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.

Mfanelo
已回答 2 年前
profile pictureAWS
专家
Toni_S
已审核 2 年前

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

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则