[Answer]-Why Redis removes relations in objects if related object is removed from database?

1👍

Django is removing it because you told it to. You are using a relational mapping in Django, then telling it to delete one of those items, which it rightly then does.

This is explained in the docs at https://docs.djangoproject.com/en/1.7/ref/models/relations/

Also, calling an item.objects.all() executes a query to the SQL db, rather than using what is in the cache. This is because you are operating, at that point, on the ORM rather than the cache. Related, storing your “items” result in the cache only caches the result, not all related items.

Leave a comment