GitHub user dosubot[bot] added a comment to the discussion: Automatic refresh
of Dashboards
<!-- Answer -->
To use Redis cache config for dashboard/chart data freshness, set up Redis as
your cache backend in superset_config.py and set CACHE_DEFAULT_TIMEOUT to 3
hours (10800 seconds). For example:
```python
DATA_CACHE_CONFIG = {
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 10800, # 3 hours
'CACHE_KEY_PREFIX': 'superset_data',
'CACHE_REDIS_URL': 'redis://your-redis-host:6379/0',
}
RESULTS_BACKEND = {
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 10800,
'CACHE_KEY_PREFIX': 'superset_results',
'CACHE_REDIS_URL': 'redis://your-redis-host:6379/0',
}
```
You can do the same for FILTER_STATE_CACHE_CONFIG and
EXPLORE_FORM_DATA_CACHE_CONFIG if needed.
This means cached data will be considered fresh for 3 hours; after that, the
next user request will trigger a fresh query and update the cache. This does
not proactively refresh data—there’s no built-in cache warm-up—so if no one
visits a dashboard after TTL expires, the data stays stale. Each chart is
cached independently, and dashboards with many charts may still load slowly if
the cache is cold or expired. For more config examples and discussion, see
[this thread](https://github.com/apache/superset/discussions/33957).
If you want to ensure data is always fresh for users, you’d need to implement
an external job to warm the cache on a schedule. Let me know if you want
details on that approach.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/b36ea0a2-3665-45a0-b6ae-0c66563035ea?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/b36ea0a2-3665-45a0-b6ae-0c66563035ea?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/b36ea0a2-3665-45a0-b6ae-0c66563035ea?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/b36ea0a2-3665-45a0-b6ae-0c66563035ea?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/b36ea0a2-3665-45a0-b6ae-0c66563035ea?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/b36ea0a2-3665-45a0-b6ae-0c66563035ea?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/b36ea0a2-3665-45a0-b6ae-0c66563035ea?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34340)
GitHub link:
https://github.com/apache/superset/discussions/34340#discussioncomment-13903240
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]