手动使超过 3000 个文件的 CloudFront 缓存失效

Manually invalidating CloudFront cache for more than 3000 files

如果我想手动邀请超过 3000 个文件到我的分发中会怎样?

文档(doc

Concurrent invalidation request maximum

If you’re invalidating files individually, you can have invalidation requests for up to 3,000 files per distribution in progress at one time. This can be one invalidation request for up to 3,000 files, up to 3,000 requests for one file each, or any other combination that doesn’t exceed 3,000 files. For example, you can submit 30 invalidation requests that invalidate 100 files each. As long as all 30 invalidation requests are still in progress, you can’t submit any more invalidation requests. If you exceed the maximum, CloudFront returns an error message.

If you’re using the * wildcard, you can have requests for up to 15 invalidation paths in progress at one time. You can also have invalidation requests for up to 3,000 individual files per distribution in progress at the same time; the maximum on wildcard invalidation requests allowed is independent of the maximum on invalidating files individually.

表示3000个以上的文件不能同时失效

当我使包含超过 3000 个文件的通配符路径无效时会发生什么?

只有前3000个失效? 还有其他的?

有没有警告? 使 3000 个文件的批次失效,直到使整个分发失效?

They indicate that more than 3000 files cannot be invalidated simultaneously

正确,单独使文件失效的最大限制目前是每个分配同时 3,000 个(无论是在 1 个失效请求还是 10 个中)。

如果您超过最大限额,CloudFront returns 会显示一条错误消息,并且不会处理将您的帐户推送到超过配额的批处理。

例如,一批 5000 个文件导致 none 失效,但是 2 批 2900 和 2100 个文件导致前 2900 个文件失效,其余文件被丢弃。

What happens when I invalidate a wildcard path that includes more than 3000 files?

这里要注意的关键点是通配符失效不同于官方的单个文件失效documentation:

The maximum on wildcard invalidation requests allowed is independent of the maximum on invalidating files individually.

如果您使用 * 通配符,您一次最多可以请求 15 个失效路径,运行 与其他失效请求同时进行 运行文件。

如果您超过最大值,CloudFront returns 一条错误消息,其行为反映上述情况。


单个文件失效通常针对特定版本的文件 - 如果您定期使超过 3000 个文件失效,则说明您的设置有问题。

改用通配符。