Backport of PR #589 to 0.9.x

Backport of PR #589 (Cache fix for Django >= 1.4) to 0.9.x