Add a way to choose the protocol for pickle.
Hi
To have a more efficient storage i needed to use another protocol for pickle, so i added a way to change the default one.
Default is 0, and change it by passing another protocol (1 or 2) in the OPTIONS dict of your cache declaration
This work is based on https://github.com/arshaver/django-redis/commit/204216808e31338023878dd8055689f0b9674e96
Twidi
PS : sorry for the noise in the list of commits, i don't now how to avoid this, but the diff is correct
FWIW, I think this is a great idea as it would reduce the size of each cache item drastically. The default pickle protocol 0 is ASCII based, which means it'll convert complex data structures to huge values. pickle.HIGHEST_PROTOCOL (or 2 on most Python distributions) should provide a smaller footprint given it's a binary format.
I added most of this to the 1.0 branch I'm working on. Thanks for your work on this and sorry of lollygaggin' :) I will close this pull request as soon as I merge it into master.