scttnlsn / dandelion

Incremental Git repository deployment.
http://scttnlsn.github.io/dandelion
MIT License
738 stars 57 forks source link

Feature: Cloudfront invalidation #135

Closed sanzaru closed 9 years ago

sanzaru commented 9 years ago

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.

scttnlsn commented 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
sanzaru commented 9 years ago

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.

scttnlsn commented 9 years ago

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:

  1. deploy files to S3 via Dandelion
  2. invalidate the Cloudfront cache

Is there something about this that won't work for your use case? Nothing in your code relies on existing Dandelion APIs.