After upgrading Django to 4.2, we started replacing python-memcached with pymemcache.
Once the switch was done, we noticed that the default setup was no longer behaving well in a high-availability scenario. If multiple memcached backends were configured and one of them went down, any cache-related code could fail with an exception instead of degrading gracefully.
After checking the official documentation, the reason became clear: by default, pymemcache raises exceptions on connection failures unless you explicitly set ignore_exc = True.
So the fix is simply to add that option to your Django CACHES settings:
1 | CACHES = { |
If you expect memcached nodes to fail independently and still want your application to continue running, this setting is easy to miss but important to have.