-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amazon S3/CloudFront API edge purge #13
Comments
It seems to work via a REST HTTP API. Since we're in a shell script, the easiest way to interact with it might be curl: http://blog.scottlowe.org/2014/02/19/using-curl-to-interact-with-a-restful-api/ |
Something like curl \
--request DELETE \
--header "X-Auth-Token: <auth-token>" \
--header "X-Purge-Email: <[email protected]>" \
https://cdn.clouddrive.com/v1/<account-id>/<container>/<object> (For security, the auth token should probably be read from a file that isn't hosted on github. :P ) |
Eg. CDN_AUTH=$(cat .cdn_auth)
CDN_MAIL=$(cat .cdn_mail)
curl \
--request DELETE \
--header "X-Auth-Token: $CDN_AUTH" \
--header "X-Purge-Email: $CDN_MAIL" \
https://cdn.clouddrive.com/v1/<account-id>/<container>/<object> |
We're now using amazon s3/cloudfront for CDN over rackspace, however the aws cli does have an included feature (albeit experimental): http://docs.aws.amazon.com/cli/latest/reference/cloudfront/create-invalidation.html |
Let's see how that works. Because waiting nearly an hour for the CDN cache to expire after the local content has already updated is bad. In the best case scenario, the local resources haven't changed significantly and your update is just delayed.
In the worst case, the new local files are incompatible with the old CDN resources, and you're left with a broken client until it updates. (I think this has happened before.)
The text was updated successfully, but these errors were encountered: