Amazon S3 Cloudfront Deployment Best Practice

后端 未结 2 1749
忘掉有多难
忘掉有多难 2021-01-30 11:07

Our current plan for a site is to use Amazon\'s Cloudfront service as a CDN for asset files such as CSS, JavaScript, and Images, and any other static files.

We currently

相关标签:
2条回答
  • 2021-01-30 12:04

    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.

    0 讨论(0)
  • 2021-01-30 12:12

    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

    0 讨论(0)
提交回复
热议问题