reidab commented on code in PR #22687: URL: https://github.com/apache/superset/pull/22687#discussion_r1068795722
########## docs/docs/installation/cache.mdx: ########## @@ -7,19 +7,46 @@ version: 1 ## Caching -Superset uses [Flask-Caching](https://flask-caching.readthedocs.io/) for caching purposes. Configuring caching is as easy as providing a custom cache config in your -`superset_config.py` that complies with [the Flask-Caching specifications](https://flask-caching.readthedocs.io/en/latest/#configuring-flask-caching). -Flask-Caching supports various caching backends, including Redis, Memcached, SimpleCache (in-memory), or the -local filesystem. Custom cache backends are also supported. See [here](https://flask-caching.readthedocs.io/en/latest/#custom-cache-backends) for specifics. -The following cache configurations can be customized: -- Metadata cache (optional): `CACHE_CONFIG` -- Charting data queried from datasets (optional): `DATA_CACHE_CONFIG` -- SQL Lab query results (optional): `RESULTS_BACKEND`. See [Async Queries via Celery](/docs/installation/async-queries-celery) for details +Superset uses [Flask-Caching](https://flask-caching.readthedocs.io/) for caching purposes. Flask-Caching supports various caching backends, including Redis (recommended), Memcached, SimpleCache (in-memory), or the local filesystem. [Custom cache backends](https://flask-caching.readthedocs.io/en/latest/#custom-cache-backends) are also supported. + +Caching can be configured by providing a dictionaries in +`superset_config.py` that comply with [the Flask-Caching config specifications](https://flask-caching.readthedocs.io/en/latest/#configuring-flask-caching). + +The following cache configurations can be customized in this way: - Dashboard filter state (required): `FILTER_STATE_CACHE_CONFIG`. - Explore chart form data (required): `EXPLORE_FORM_DATA_CACHE_CONFIG` +- Metadata cache (optional): `CACHE_CONFIG` +- Charting data queried from datasets (optional): `DATA_CACHE_CONFIG` + +For example, to configure the filter state cache using redis: + +```python +FILTER_STATE_CACHE_CONFIG = { + 'CACHE_TYPE': 'RedisCache', + 'CACHE_DEFAULT_TIMEOUT': 86400, + 'CACHE_KEY_PREFIX': 'superset_filter_cache', + 'CACHE_REDIS_URL': 'redis://localhost:6379/0' +} +``` + +For chart data, Superset goes up a “timeout search path”, from the chart's configuration +to the dataset’s, the database’s, then ultimately falls back to the global default +defined in `DATA_CACHE_CONFIG`. Review Comment: @villebro Thanks! That helps to clarify it. I hadn't understood that this was referring to just the timeout, but it makes sense now. I rewrote it a bit to be more explicit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org