Q73 — AWS SOA-C02 Ch.1
Question 73 of 100 | ← Chapter 1
A company hosts a static website on Amazon S3. An Amazon CloudFront distribution presents this site to global users. The company uses the Managed CachingDisabled CloudFront cache policy. The company's developers confirm that they frequently update a file in Amazon S3 with new information. Users report that the website presents correct information when the website first loads the file. However, the users' browsers do not retrieve the updated file after a refresh. What should a SysOps administrator recommend to fix this issue?
- A. Add a Cache-Control header field with max-age=0 to the S3 object. ✓
- B. Change the CloudFront cache policy to Managed-CachingOptimized.
- C. Disable bucket versioning in the S3 bucket configuration.
- D. Enable content compression in the CloudFront configuration.
Correct Answer: A. Add a Cache-Control header field with max-age=0 to the S3 object.
Explanation
Amazon S3静态网站结合CloudFront分发时,缓存行为由CloudFront缓存策略和源服务器的HTTP头共同控制。题目中使用的Managed-CachingDisabled策略会禁用缓存优化,但此时问题仍出在浏览器未获取最新版本的对象。S3对象的默认Cache-Control头部可能未被覆盖,导致浏览器依然缓存旧版本内容。AWS文档指出,若源站未设置缓存头部,客户端可能基于默认行为缓存资源。选项A通过添加max-age=0的Cache-Control头部,强制浏览器每次刷新时重新验证资源。选项B调整的缓存策略与问题场景无关,Managed-CachingOptimized适用于通用缓存优化场景。选项C和D与缓存失效逻辑无关。