Does cached questions update after metabase sync?

Suppose I saved a question. It was above threshold-query-time, so it was cached.
Now metabase completed its daily sync (hourly, daily all kind of sync)
Now will question re-run after sync ? If yes, on application db or source db ?
If no, when it will get updated ? After cache TTL expires & someone requests the answer of that question (through dashboard card for that question or visiting question directly) ?

Please clear my doubts.
Thanks in advance

No, caching is only done after users hit those questions several times. You're probably looking for Automatically refresh question cache instead of expiring · Issue #30119 · metabase/metabase · GitHub

thanks for the response, however my question was that - suppose a saved question is to get count of US users who bought subscription. It saved the answer as 4500 in cache. Now say, cache TTL was 6 hours. Meanwhile in source db , more users bought subscription and actual business answer for this question is 5000 users count. So after cache expires (6 hours), will the question re-run the query on source db and update its count in cache as 5000 ?
The auto-refreshing cache github issue link which you have attached, i assume it will just increase the TTL of cache, not update the answer from source db after 6 hours. Right ?

Also suppose it is not updating after 6 hours, after 24 hours when metabase will complete its daily big sync, will it update it to 5000 after that ?


Metabase will never update the cached values of the questions. It will only update if the questions are run

And when questions are re-run ? when cache ttl expires, right ?

No, queries won’t re run automatically . The only feature we have for auto running queries is model caching. Question caching won’t run automaticall

1 Like

Okay so, next time dashboard requests that question (whose cache has expired), that question/query will then re-run & fetch latest values & updates its cache for the specified TTL.

Also for models cache, once a model's cache has expired, so when a question referring it is executed, model will fetch latest rows & store that in its cache

Model cache will refresh on a specified basis (you set that in the settings)

1 Like