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
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