mtigas/django-medusa — pull request #2 by rlander (2012-07-05 01:21:28+00:00)
Title: Check if generated file was modified before uploading to S3

I think it's kinda wasteful to upload all files to S3 on every ./manage staticsitegen run, so I refactored _s3render_path to check the md5 hash against the key's etag (if it exists).

Boto's #compute_md5 method expects a file object, so the function creates an in-memory file using cStringIO, a faster StringIO. If you find any problems, I could switch it for an in-disk NamedRemporaryFile.