Graham Knapp

TIL: Django caching doesn't cross versions

written by Graham Knapp on 2025-02-11

Reading into this issue on Django-waffle I learned that Django uses pickle to store objects in its cache but does not guarantee that these objects will remain valid between versions, so it raises a RuntimeWarning when you access potentially stale objects.

The Django docs recommend clearing the cache on upgrade, and this Stackoverflow post discusses ways of doing that.

python django