cache.set(key, value, 9999999)
But this is not infinite time...
From the docs:
If the value of this settings is None, cache entries will not expire.
Notably, this is different from how the expiration time works in the Memcache standard protocol:
Expiration times can be set from 0, meaning "never expire", to 30 days. Any time higher than 30 days is interpreted as a unix timestamp date
So, to set a key to never expire, set the timeout to None
if you're using Django's cache abstraction, or 0
if you're using Memcache more directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With