AWS Cloudfront 失效未按预期工作

LPD*_*LPD 6 amazon-s3 invalidation amazon-web-services amazon-cloudfront

我有一个与失效相关的疑问。

我在 s3 存储桶上创建了一个测试页面。Cloudfront 上设置的 TTL 为 1 周。但我对测试页做了一些修改。我将失效运行为“/*”,并期望所有文件都从缓存中逐出。

但页面仍然从 Cloudfront 缓存提供服务 --> 响应标头显示“x-cache: Hit from cloudfront”

我不确定我在这里缺少什么,请提出建议。非常感谢您的建议。

Haa*_*Leo 6

我的问题是我在 macOS 上运行了以下命令:

aws --profile myprofile cloudfront create-invalidation --distribution-id someID --paths /*
Run Code Online (Sandbox Code Playgroud)

结果我的 shell 扩展/*到以下路径,导致错误的失效:

/Applications
/home
/Volumes
/private
/Users
/bin
/sbin
/var
/dev
/usr
...
Run Code Online (Sandbox Code Playgroud)

转义/*'/*'解决问题:

aws --profile myprofile cloudfront create-invalidation --distribution-id someID --paths '/*'
Run Code Online (Sandbox Code Playgroud)


LPD*_*LPD 0

请忽略这个问题。我想到了这个问题。这是基本的配置问题,最终导致错误的存储桶失效。因此,数据始终来自缓存。抱歉,添麻烦了。