Closed sanzaru closed 9 years ago
@sanzaru Thanks but I don't think this belongs in Dandelion. The Cloudfront invalidation could be another step in a larger build/deployment process. i.e.
#!/usr/bin/env bash
dandelion deploy
./invalidate_cloudfront
The problem is, that the deployed files on S3 are cached in Cloudfront until you invalidate, but the user usually wants to deliver the new files after deploy. Without invalidation the deploy to S3 makes no real sense, if you use Cloudfront.
I understand, however, there's no need to do the invalidation as part of the Dandelion deploy. Like I suggested above, have a multi-step deployment process:
Is there something about this that won't work for your use case? Nothing in your code relies on existing Dandelion APIs.
I implemented invalidation functionality for Amazon Cloudfront with the help of a gem:
https://github.com/reidiculous/cloudfront-invalidator
If you have your S3 bucket in combination with Cloudfront it is sometimes required to invalidate the cache, otherwise old files will be delivered after a deploy is made.