Move expire from callback manager to long_callback
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
The current caching possibilities when using long_callback are configured via the diskcache or celery callback manager - "globally" for a dash app.
Both accept the expire argument to define a cache expiration time.
This is somewhat unfortunate in case there are multiple long callbacks, for which totally different cache expiration times might be applicable:
- there might be long callbacks for querying more or less static metadata, I'm thinking of dropdown menus populated by selecting distinct values from somewhere. That might expire only every 24hours.
- in other callbacks querying frequently changing data cache expiration times of a few minutes might make sense
Describe alternatives you've considered
If long_callback would also accept and forward the expire argument to the caching backend, that would make things much more flexible.
Additional context
How might "mixing" long_callback with other caching possibilities like Flask-Caching work?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the long_callback entry point and the diskcache and celery callback managers that currently receive expire. Determine how a per-callback expiration value could reach the caching backend without breaking the existing global configuration, then verify that separate long callbacks can use different expiration times.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100