Is it possible to get key's expire time in Django using Redis cache?
Something like:
from django.core.cache import cache
cache.get_expire('mykey') # 300 (seconds)
I tried:
cache.ttl('my_key')
getting an error
AttributeError: 'RedisCache' object has no attribute 'ttl'
There is no official API to get
TTLfromRedisCachebackend in Django (as ofDjango 4.2); but we can customize the backend like -and then update your
settings.pyResults