ferrix/django-cumulus — comment on commit 3682344a8a950f39a40340ce47ad376405860735
File:  line 0
By poswald:

*We should get all files in a bunch, yes.*

We already get all of the metadata for all of the files in a single call. We don't need to use the etag for each file.

*I don't know any better ways of futureproofing without extra effort.*

In the sync code I added, Rackspace already sends down the hash to us beforehand in the `cloudfile_info_list` so you can just do:

if cloudfile_info_list['hash'] == compute_file_hash(file):
# skip the download

We just need to write a `compute_file_hash` function or call to get the local file's sha or whatever. Add a `print self.cloudfile_info_list` to line 90 or so to see what I'm talking about. Inside of that info list is the following:

u'hash': u'56d3661264cce360ac3df5fca33c9d3a'

Which I believe is a sha1 of the actual file contents and doesn't depend on the etag which may or may not be (but currently happens to be) an md5 of the file's contents. I understand that rackspace uses md5 for that in their library now but I sort of view that as unstable api whereas the return value of the `list_objects_info()` call is part of their public api.