Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default cache timeout #40

Closed
morrah opened this issue Mar 5, 2021 · 0 comments
Closed

Default cache timeout #40

morrah opened this issue Mar 5, 2021 · 0 comments
Labels
question Further information is requested

Comments

@morrah
Copy link

morrah commented Mar 5, 2021

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?

@morrah morrah added the question Further information is requested label Mar 5, 2021
Repository owner locked and limited conversation to collaborators Mar 5, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants