Skip to content

Instantly share code, notes, and snippets.

@ptone
Created October 8, 2012 16:38
Show Gist options
  • Save ptone/3853484 to your computer and use it in GitHub Desktop.
Save ptone/3853484 to your computer and use it in GitHub Desktop.
In an ideal world - checksums would be an perfectly viable way to compare
files. However, practically - they can't be well supported by the collectstatic
API.
While md5 may be somewhat common - it is neither universal nor standard. For
cloud based storage backends to support a comparison metric other than
modification times for use by collectstatic, they would need to provide that
value as a remote/api call, it would do no good if the only way to support this
involved retrieving the remote object to get a hash on it (even if you had
drastically asymetrical bandwidth - this is just poor design).
Checksums have a compute cost that modification dates don't - so a checksum
comparison would always need to be an alternate, not the primary comparison.
Without a good universal way for a range of storage backends to provide some
sort of fingerprint/hash - there is no good way for collectstatic to take
advantage of that approach.
In cases where your modification dates are rendered invalid because of some
specific environment set up (like the git based team issue), there are a couple
workarounds. Perhaps the best is to use collectstatic locally - where the
performance of copying every file isn't as bad, and then use a sync tool (such
as rsync --checksum) or something home built that can do the checksum based
comparison knowing the specific remote storage you are working with in your
project.
http://gitorious.org/sstamp
http://repo.or.cz/w/metastore.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment