Search code examples
amazon-web-servicesamazon-s3amazon-cloudfront

Is CloudFront origin using S3 global domain name performing better than regional one?


I have a CloudFront distribution that has S3 in eu-west-1 as origin.

I know that S3 regional domain name {bucket-name}.s3.{region}.amazonaws.com give me instant initial CloudFront initialisation without downtime. Global {bucket-name}.s3.amazonaws.com needs 2~3 hours to be initialized (see https://stackoverflow.com/a/58423033/1480391).

Does CloudFront perform the same with regional or global S3 domain name?

Is regional S3 domain name slower than global S3 domain name regarding how CloudFront fetches S3 origin (internal DNS domain resolution for example)?


Solution

  • Global endpoint is deprecated

    https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html

    The global endpoint is called "legacy". That means the new way is to systematically use the regional endpoint.

    Also the regional endpoint performs better. To simplify, when using the global (legacy) S3 URL format:

    1. Requests the global S3 endpoint.
    2. It asks what the regional S3 endpoint is.
    3. Redirects you to the regional S3 endpoint.
    4. Requests the regional S3 endpoint.

    When you use the regional (modern) S3 URL format:

    1. Requests the regional S3 endpoint.

    All credits to this reddit answer