You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mdenison (via GitHub)" <gi...@apache.org> on 2026/03/12 15:37:39 UTC
[I] Cache Timeout does not invalidate cache [superset]
mdenison opened a new issue, #38605:
URL: https://github.com/apache/superset/issues/38605
### Bug description
When using S3Cache as the Cache Backend for `DATA_CACHE_CONFIG` the Cache Timeout is not respected when charts are fetched. Neither the `CACHE_DEFAULT_TIMEOUT` of 86400 is used nor if I configure a Cache Timeout on Dataset level.
Below is the response when I set the Cache Timeout to 10 seconds.
```{
"result": [
{
"cache_key": "0ccc532b072680aeb65955c39ca75392",
"cached_dttm": "2026-03-12T14:55:45",
"cache_timeout": 10,
"applied_template_filters": [],
"annotation_data": {},
"error": null,
"is_cached": true,
......
```
### Screenshots/recordings
Users sees that the Data was cached a longer time then what the Cache Timeout is:
<img width="670" height="120" alt="Image" src="https://github.com/user-attachments/assets/6dccddc3-2e22-4d1c-8059-2e5b839d9169" />
Also the Cached Data still resides on S3:
<img width="884" height="57" alt="Image" src="https://github.com/user-attachments/assets/d790def2-1214-494c-8c86-6c7bc380497d" />
### Superset version
6.0.0
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
Users started reporting this once we migrated from 5.0.0 to 6.0.0. Also still an issue with 6.0.1rc1.
If anyone maybe knows why this is happening, I would be happy to know.
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Cache Timeout does not invalidate cache [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #38605:
URL: https://github.com/apache/superset/issues/38605#issuecomment-4047909478
<!-- Answer -->
This appears to be a **known regression in Superset 6.0.0**. Another user reported the [same behavior in a recent discussion](https://github.com/apache/superset/discussions/38355) — cache timeout is being returned correctly in API responses but not actually enforced, causing stale data to persist.
**Likely cause**: Between 5.0.0 and 6.0.0, cache handling was refactored in [PR #34654](https://github.com/apache/superset/pull/34654) to centralize the `-1` timeout logic (cache bypass). This may have inadvertently affected how positive timeout values are validated against `cached_dttm`.
**Workarounds until a fix is available**:
1. **Force refresh** via the UI context menu when needed
2. **Enable cache key tracking** for programmatic invalidation:
```python
STORE_CACHE_KEYS_IN_METADATA_DB = True
```
Then use the `/api/v1/cachekey/invalidate` endpoint to clear stale entries.
3. **Set S3 lifecycle policies** as a backup mechanism to delete objects after your intended TTL
4. **Test with a different cache backend** (Redis/SimpleCache) to confirm whether this is S3-specific or affects all backends
I'd recommend adding your configuration details to the [existing discussion](https://github.com/apache/superset/discussions/38355) to help maintainers reproduce and fix this.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ffa044a8-351d-4c1c-a0b5-e719f622a018?feedback_type=great_response&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ffa044a8-351d-4c1c-a0b5-e719f622a018?feedback_type=irrelevant_answer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ffa044a8-351d-4c1c-a0b5-e719f622a018?feedback_type=incorrect_sources&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ffa044a8-351d-4c1c-a0b5-e719f622a018?feedback_type=too_verbose&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ffa044a8-351d
-4c1c-a0b5-e719f622a018?feedback_type=hallucination&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ffa044a8-351d-4c1c-a0b5-e719f622a018?feedback_type=bug_report&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report) | [Other](https://app.dosu.dev/response-feedback/ffa044a8-351d-4c1c-a0b5-e719f622a018?feedback_type=other&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=This%20appears%20to%20be%20a%20%2A%2Aknown%20regression%20in%20Superset%206.0.0%2A%2A.%20Another%20user%20reported%20the%20%5Bsame%20behavior%20in%20a%20recent%20discussion%5D%28https%3A//github.com/apache/superset/discussions/38355%29%20%E2%80%94%20cache%20timeout%20is%20being%20returned%20correctly%20in%20API%20responses%20but%20not%20actually%20enforced%2C%20causing%20stale%20data%20to%20persist.%0A%0A%2A%2ALikely%20cause%2A%2A%3A%20Between%205.0.0%20and%206.0.0%2C%20cache%20handling%20was%20refactored%20in%20%5BPR%20%2334654%5D%28https%3A//github.com/apache/superset/pull/34654%29%20to%20centralize%20the%20%60-1%60%20timeout%20logic%20%28cache%20bypass%29.%20This%20may%2
0have%20inadvertently%20affected%20how%20positive%20timeout%20values%20are%20validated%20against%20%60cached_dttm%60.%0A%0A%2A%2AWorkarounds%20until%20a%20fix%20is%20available%2A%2A%3A%0A%0A1.%20%2A%2AForce%20refresh%2A%2A%20via%20the%20UI%20context%20menu%20when%20needed%0A2.%20%2A%2AEnable%20cache%20key%20tracking%2A%2A%20for%20programmatic%20invalidation%3A%0A%20%20%20%60%60%60python%0A%20%20%20STORE_CACHE_KEYS_IN_METADATA_DB%20%3D%20True%0A%20%20%20%60%60%60%0A%20%20%20Then%20use%20the%20%60/api/v1/cachekey/invalidate%60%20endpoint%20to%20clear%20stale%20entries.%0A3.%20%2A%2ASet%20S3%20lifecycle%20policies%2A%2A%20as%20a%20backup%20mechanism%20to%20delete%20objects%20after%20your%20intended%20TTL%0A4.%20%2A%2ATest%20with%20a%20different%20cache%20backend%2A%2A%20%28Redis/SimpleCache%29%20to%20confirm%20whether%20this%20is%20S3-specific%20or%20affects%20all%20backends%0A%0AI%27d%20recommend%20adding%20your%20configuration%20details%20to%20the%20%5Bexisting%20discussion%5D%28http
s%3A//github.com/apache/superset/discussions/38355%29%20to%20help%20maintainers%20reproduce%20and%20fix%20this.) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38605)
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Cache Timeout does not invalidate cache [superset]
Posted by "mdenison (via GitHub)" <gi...@apache.org>.
mdenison commented on issue #38605:
URL: https://github.com/apache/superset/issues/38605#issuecomment-4053370706
Thanks @dosu . I narrowed it down to being an S3Cache issue somehow. I've tried it with version 5.0.0, 6.0.0 and 6.0.1rc1 and with every version it failed. If I use `SupersetMetastoreCache` it works how its intended!
Your workarounds:
1. Yes, thats what users do currently
2. I will try that, but want to avoid manually invalidating the cache
3. Yes, that works but not very reliable since lifecycle policies don't get triggered on a commited time period on S3
4. Yup, must be the S3 Cache somehow. I will try to narrow it down a bit more!
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Cache Timeout does not invalidate cache [superset]
Posted by "mdenison (via GitHub)" <gi...@apache.org>.
mdenison commented on issue #38605:
URL: https://github.com/apache/superset/issues/38605#issuecomment-4053812345
I think this is really an S3Cache issue. Since `SupersetMetastoreCache` works without an issue and I've just tested it with `RedisCache` and it also worked without an issue. So I guess this Issue can be closed.
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Cache Timeout does not invalidate cache [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #38605:
URL: https://github.com/apache/superset/issues/38605#issuecomment-4053380956
<!-- Answer -->
Great detective work narrowing it down to S3Cache specifically! That's really helpful.
The key difference is that [SupersetMetastoreCache actively manages expiration](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/extensions/metastore_cache.py#L74-L78) by converting the timeout to an absolute datetime and storing it in the database — then checking it on retrieval. S3Cache, being an external library (`s3cache.s3cache.S3Cache`), is responsible for its own TTL enforcement, and it appears it's not properly checking expiration when fetching cached values.
This is likely a bug in the `s3cache` library itself rather than Superset. The library may be:
- Not storing TTL metadata with the S3 objects
- Storing it but not checking it on retrieval
- Relying entirely on S3 lifecycle policies (which as you noted aren't reliable for precise timing)
If you're able to narrow it down further, it would be worth reporting upstream to the `s3cache` library maintainers. In the meantime, `SupersetMetastoreCache` is a solid alternative if your volume permits database-backed caching.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/4b46eb73-6763-4c9c-9d7c-2cb3b8600eb9?feedback_type=great_response&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4b46eb73-6763-4c9c-9d7c-2cb3b8600eb9?feedback_type=irrelevant_answer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4b46eb73-6763-4c9c-9d7c-2cb3b8600eb9?feedback_type=incorrect_sources&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4b46eb73-6763-4c9c-9d7c-2cb3b8600eb9?feedback_type=too_verbose&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4b46eb73-6763
-4c9c-9d7c-2cb3b8600eb9?feedback_type=hallucination&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4b46eb73-6763-4c9c-9d7c-2cb3b8600eb9?feedback_type=bug_report&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report) | [Other](https://app.dosu.dev/response-feedback/4b46eb73-6763-4c9c-9d7c-2cb3b8600eb9?feedback_type=other&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=Great%20detective%20work%20narrowing%20it%20down%20to%20S3Cache%20specifically%21%20That%27s%20really%20helpful.%0A%0AThe%20key%20difference%20is%20that%20%5BSupersetMetastoreCache%20actively%20manages%20expiration%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/extensions/metastore_cache.py%23L74-L78%29%20by%20converting%20the%20timeout%20to%20an%20absolute%20datetime%20and%20storing%20it%20in%20the%20database%20%E2%80%94%20then%20checking%20it%20on%20retrieval.%20S3Cache%2C%20being%20an%20external%20library%20%28%60s3cache.s3cache.S3Cache%60%29%2C%20is%20responsible%20for%20its%20own%20TTL%20enforcement%2C%20and%20it%20appe
ars%20it%27s%20not%20properly%20checking%20expiration%20when%20fetching%20cached%20values.%0A%0AThis%20is%20likely%20a%20bug%20in%20the%20%60s3cache%60%20library%20itself%20rather%20than%20Superset.%20The%20library%20may%20be%3A%0A-%20Not%20storing%20TTL%20metadata%20with%20the%20S3%20objects%0A-%20Storing%20it%20but%20not%20checking%20it%20on%20retrieval%0A-%20Relying%20entirely%20on%20S3%20lifecycle%20policies%20%28which%20as%20you%20noted%20aren%27t%20reliable%20for%20precise%20timing%29%0A%0AIf%20you%27re%20able%20to%20narrow%20it%20down%20further%2C%20it%20would%20be%20worth%20reporting%20upstream%20to%20the%20%60s3cache%60%20library%20maintainers.%20In%20the%20meantime%2C%20%60SupersetMetastoreCache%60%20is%20a%20solid%20alternative%20if%20your%20volume%20permits%20database-backed%20caching.) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=
github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38605)
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Cache Timeout does not invalidate cache [superset]
Posted by "mdenison (via GitHub)" <gi...@apache.org>.
mdenison closed issue #38605: Cache Timeout does not invalidate cache
URL: https://github.com/apache/superset/issues/38605
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org