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
demandé il y a 2 ans1982 vues
1 réponse
0
Réponse acceptée

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
répondu il y a 2 ans
profile pictureAWS
EXPERT
Toni_S
vérifié il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions