考题解析 | 使用 Amazon CloudFront 提高 S3 托管静态网站的访问性能


  题目

A company is hosting a static website on Amazon S3 and is using Amazon Route 53 for DNS. The website is experiencing increased demand from around the world. The company must decrease latency for users who access the website.
Which solution meets these requirements MOST cost-effectively?
A. Replicate the S3 bucket that contains the website to all AWS Regions. Add Route 53 geolocation routing entries.
B. Provision accelerators in AWS Global Accelerator. Associate the supplied IP addresses with the S3 bucket. Edit the Route 53 entries to point to the IP addresses of the accelerators.
C. Add an Amazon CloudFront distribution in front of the S3 bucket. Edit the Route 53 entries to point to the CloudFront distribution.
D. Enable S3 Transfer Acceleration on the bucket. Edit the Route 53 entries to point to the new endpoint.

  参考答案

C

  参考解析

技巧:排除明显错误选项,在没有明显错误的选项中选择最合理的选项。
一家公司在 Amazon S3 上托管了一个静态网站,并使用 Amazon Route 53 进行 DNS 管理。该网站的全球访问需求正在增加。公司必须减少用户访问网站的延迟。哪个解决方案能以最经济高效的方式满足这些要求?

A. 不正确。将包含网站的 S3 存储桶复制到所有 AWS 区域。添加 Route 53 地理位置路由条目。S3 支持跨区域复制,但它是用于数据冗余和合规性,而不是直接用于降低延迟。静态网站的内容是只读的,用户仍然需要通过原始存储桶的 URL 访问,而不是通过复制的存储桶访问。该方案需要在多个区域复制数据,增加存储成本,而且无法直接降低延迟。
B. 不正确。在 AWS Global Accelerator 中配置加速器。将提供的 IP 地址与 S3 存储桶关联。编辑 Route 53 条目以指向加速器的 IP 地址。WS Global Accelerator 主要用于动态应用(如游戏、API 等),通过 Anycast IP 和边缘位置优化网络路径。对于静态网站,Global Accelerator 并不是最佳选择,因为它无法直接与 S3 静态网站集成。S3 静态网站需要通过 HTTP/HTTPS 访问,而 Global Accelerator 主要用于 TCP/UDP 流量。Global Accelerator 是付费服务,对于静态网站来说,成本较高且不必要。
C. 正确。在 S3 存储桶前添加 Amazon CloudFront 分发。编辑 Route 53 条目以指向 CloudFront 分发。Amazon CloudFront 是 AWS 的内容分发网络(CDN),专为降低延迟和加速内容分发而设计。通过将内容缓存到全球边缘位置,用户可以从最近的边缘位置获取内容,从而显著降低延迟。CloudFront 完全支持 S3 静态网站,可以通过配置 S3 作为源(Origin)轻松集成。只需修改 Route 53 的 CNAME 或 ALIAS 记录,将域名指向 CloudFront 分配的域名。CloudFront 的定价基于数据传输和请求数量,对于静态网站来说,通常比其他方案更经济高效。无需在多个区域复制数据,节省存储成本。
D. 不正确。在存储桶上启用 S3 Transfer Acceleration。编辑 Route 53 条目以指向新的端点。S3 Transfer Acceleration 主要用于加速大文件上传到 S3(如通过 PUT/POST 请求),而不是加速用户下载内容。
它通过 AWS 边缘位置优化上传路径,但不适用于静态网站的内容分发。静态网站的用户访问是 GET 请求,S3 Transfer Acceleration 无法降低这些请求的延迟。