awesto / django-shop

A Django based shop system
http://www.django-shop.org
BSD 3-Clause "New" or "Revised" License
3.17k stars 1.04k forks source link

changed caching behavior #829

Open markusmo opened 3 years ago

markusmo commented 3 years ago

I just setup my shop together with django-redis-cache package and I got an error, when changing a model, when it wanted to invalidate mny So I adapted the code in product.py to use Django caching API's delete(key).

See: https://docs.djangoproject.com/en/3.0/topics/cache/#django.core.caches.cache.delete

jrief commented 3 years ago

OK. This looks like an API change in the redis-cache library. Can we restrict the versions which are compatible with those changes.

markusmo commented 3 years ago

Well redis-cache did not work with the current new version, so I had to upgrade. Using the standard django caching will result in redis-cache to be triggerd or any other cache that will be used. So this would be an agnostic aproach