Amazon S3 Cloudfront Deployment Best Practice

二次信任 提交于 2019-12-02 15:13:29

You can issue invalidation requests to CloudFront.

http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html

Instead of an S3 bucket, though, we use our own server as a custom origin. We have .htaccess alias style_*.css to style.css, and we inject the file modification time for style.css in the HTML. As CloudFront sees a totally different URL, it'll fetch the new version.

(Note: Some CDNs let you do that via query string, but CloudFront ignores all query string data for caching, hence the .htaccess solution.)

edit: CloudFront can be (optionally) configured to use query strings now.

CloudFront has started supporting query strings, which you can use to invalidate cache. http://aws.typepad.com/aws/2012/05/amazon-cloudfront-support-for-dynamic-content.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!