Does Amazon S3 send invalidation signals to CloudFront?

前端 未结 2 2144
花落未央
花落未央 2021-01-01 22:13

I can\'t seem to see an obvious answer in the documentation.

When I update a file on S3 and I have CloudFront enabled, does S3 send an invalidation signal to CloudF

2条回答
  •  轮回少年
    2021-01-01 22:36

    As far as I know, all CDNs work like this.

    It's why you generally use something like foo-x.y.z.ext to version assets on a CDN. I wouldn't use foo.ext?x.y.z because there was something about certain browsers and proxies never caching assets with a ?QUERY_STRING.

    In general you may want to check this out: https://developers.google.com/speed/docs/best-practices/caching

    It contains lots of best practices and goes into details what to do and how it works.

    In regard to S3 and Cloudfront, I'm not super familiar with the cache invalidation, but what Frederick Cheung mentioned is all correct.

    Some providers also allow you to clear the cache directly but because of the nature of a CDN these changes are almost never instant. Another method is to set a smaller TTL (expiration headers) so assets will be refreshed more often. But I think that defeats the purpose of a CDN as well.

    In our case (Edgecast), cache invalidation is possible (a manual process) and free of charge, but we rarely do this because we version our assets accordingly.

提交回复
热议问题