Closed henadzit closed 3 years ago
Hi there, I think it make sense to at least remove the None
param in the cache.set
to use the default cache value. Having a dedicated setting dynamic_preferences
for this (defaulting to the default cache timeout) would also work great!
At the moment django-dynamic-preferences caches values indefinitely if caching is used. There are potentials issues with this approach where the database and the cache get out of sync. There are a few examples of how this could happen:
Having a timeout would also let to update the setting in the database directly without using Django. At the moment this would require clearing cache manually.
I see three potential paths to introduce more flexible caching:
None
from arguments of the callself.cache.set(key, value, None)
here. This will make Django to use the default cache timeout.Please let me know what you think and I can help with PR for this change.