I use Django cache with django-redis==5.0.0 like this:
cache.set(f'clean_me_up_{id}', timeout=10)
Storing an entry into cache, which will be cleared after timeout, works perfectly for me.
What I´m trying to acheive, is to execute also some cleanup code (as a callback?) when the cache is deleted.
Is there some easy way to do this as it would be extremely helpful.