pieter michels

Github    Ask me anything   

February 8, 2011 at 10:25pm

Home

Amazon CloudFront invalidation for Appoxy AWS Library

Amazon S3 is a great service for file storage. Combined with Amazon CloudFront you have access to a high availability CDN for a very low cost. It’s as simple as ‘putting’ your files on Amazon S3, enable CloudFront access and see the powerful CDN cache hits in.

The only problem is that cache timeout of files you deliver through CloudFront can be large. This is generally a good thing, that’s what cache is for but there are times you need to propagate a change immediately. If you want your new version the moment you updated it (almost) you will need to invalidate your files.

I was using the Appoxy AWS Library (a Ruby gem) extensively when I realized it didn’t support the invalidation of files yet. Amazon made invalidation available just a couple of months ago. Luckily the gem was available on Github so I forked it and added the functionality I need. Please do tweak the method and make it more efficient and put some obligatory error catching in it. This is still just a quick fix for me. But I hope it will be merged in the main repository soon.

Forked Github repository: https://github.com/pierot/aws 
Original Github repository: https://github.com/appoxy/aws/ 

Extra information on invalidation requests.

Notes

  1. pieterm posted this