-
-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Default cache TTL is 300s, but default django session is 2 weeks; user could want to have a page opened for almost 2 weeks but 5 minutes later he gets 404 responses only.
Does it make sense to set default timeout for select2 cache to a first explicitly declared timeout or to a default session age otherwise?
Kinda
if settings.SELECT2_CACHE_BACKEND:
timeouts = [
settings.get('CACHES', {}).get(settings.SELECT2_CACHE_BACKEND, {}).get('TIMEOUT'),
settings.SESSION_COOKIE_AGE,
60*60*24*7*2, # default 2 weeks https://docs.djangoproject.com/en/3.1/ref/settings/#session-cookie-age
]
default_timeout = list(filter(None, timeouts)).pop(0)Also another question somehow linked to caching.
Curious about reasons behind using uuid for every widget instance instead of predictable hashing for a db field - 'database name + table name + column name' as a hash input for example.
Thus we don't need to use cache as an external consistent storage for uuids, because every django process can calculate this same field_id on its own.
Though it requires to whitelist somewhere (in settings?) select2-accessible db fields. What are the other downsides?