Metabase caching policies: when a busy instance needs them
A caching policy in Metabase reuses a saved query result for a set lifetime, so repeated views of the same dashboard or question do not send the same query to your warehouse again and again. If popular dashboards on your self-hosted instance hammer the warehouse and users wait on identical queries, caching is the first control to evaluate. Caching is configured per question, per dashboard and per database, and each level can carry its own policy, so you can cache a heavy executive dashboard without changing how an ad hoc exploration runs. Treat it as a performance control. It does not fix a slow model, a poorly joined question or an overbuilt dashboard, and it does not decide who can see which rows.
Before you set a policy, identify which content is actually slow and which is viewed most often. Check whether the same questions run for many people with the same filters, because those benefit most. Then pick the policy type: a fixed duration, a schedule that refreshes results at chosen times, or adaptive caching, where Metabase sets the lifetime from how long the query usually takes. The adaptive approach multiplies a query's average execution time by a multiplier, so a query that normally takes 10 seconds with a multiplier of 100 is cached for 1,000 seconds. Slow queries therefore stay cached longer. Confirm the multiplier and the policy options against your Metabase version in the Metabase caching documentation.
Cache size is the control teams most often overlook. The MB_QUERY_CACHING_MAX_KB environment variable sets the maximum cached result size per saved question and defaults to 2,000 KB, so large result sets are not cached at all unless you raise the limit. Raising it trades application database storage and memory for fewer warehouse hits, so test it against your largest dashboards. Also check permissions early. Caching and refresh jobs run under a configured setup, and some permission designs, particularly those that vary results per user, can stop refresh from working as you expect. Confirm how your chosen permission model interacts with caching in a test instance before you roll the policy out to production.
Duration, schedule and adaptive caching compared
Metabase lets you choose how long cached results stay valid for each question, dashboard or database. The three modes differ in what sets the cache lifetime: a fixed clock period, a refresh time of day, or the measured cost of the query itself. Pick the mode that matches how often the underlying data changes and how expensive the query is to run.
Fixed duration caching
A fixed duration keeps a cached result for a set period after it is generated, regardless of when the data changes. It suits stable reporting, such as a monthly finance summary, where viewers accept a result that may be a few hours old. The main check is whether the business accepts that staleness window, because a short duration on a heavy dashboard can still send repeated queries to the warehouse. Confirm the exact duration fields and units in your Metabase version.
Caching docsRefresh schedule caching
A refresh schedule rebuilds the cache at fixed times, such as before the start of a business day. Viewers then read a result that was prepared ahead of demand, so the warehouse work lands in a predictable window. This mode fits dashboards that executives open at the same time each morning. The risk is that data arriving after the scheduled refresh stays invisible until the next run, so align the schedule with your load and pipeline times.
Adaptive caching by query cost
Adaptive caching sets the cache lifetime from a question's average execution time multiplied by a multiplier. In the documented example, a 10 second average multiplied by 100 gives a 1,000 second lifetime, so slow queries stay cached longer than fast ones. This suits mixed workloads where a few expensive queries cause most of the load. Ask your team to review the average execution times before choosing the multiplier, because a sudden slowdown in the warehouse will also lengthen cache lifetimes.
Choosing the mode per object
Caching settings apply to questions, dashboards and databases, and a more specific setting generally overrides a broader one. Give a live operational dashboard a short fixed duration, a weekly executive pack a refresh schedule, and an ad hoc exploration question adaptive caching or no cache. Document which mode applies to each object so that a future editor does not assume a parent setting still governs a child. Confirm the override order in your version before relying on it.
Caching options by scope and when each fits
This table compares the caching modes Metabase offers at the question, dashboard and database levels, with the typical reason to pick each and its main trade-off. Read each row against the scope you are tuning, then confirm which modes your Metabase version exposes in its caching settings before you commit to a policy.
| Scope and mode | What it governs | When it fits | Main trade-off |
|---|---|---|---|
| Question, duration | How long one saved question's cached results stay valid before the query runs again | A question that is expensive to run and whose answer changes slowly, such as a monthly finance summary | Viewers may see results older than the underlying data; the warehouse is spared repeated runs |
| Question, adaptive | Cache lifetime set from the question's average execution time multiplied by a multiplier | Mixed questions where slow queries should be cached longer than fast ones without a single fixed number | Lifetime tracks query cost, not business freshness needs, so review the multiplier for time-sensitive questions |
| Question, schedule | Cached results refreshed at fixed times, so viewers read the last refreshed copy | Questions whose data loads at known times, such as after a nightly batch | Results are stale between refreshes; a failed or late refresh leaves old data on screen |
| Dashboard, duration or schedule | Caching applied to the dashboard as a whole, covering its cards together | Dashboards with many cards that share the same underlying data and audience | Cards may share a stale window even when only one card's source changed; confirm how your version handles per-card refresh |
| Database, duration or schedule | Caching policy applied to every question built on one connected database | A warehouse with a predictable load pattern and many questions that can tolerate the same freshness | Broad settings can cache time-sensitive questions too; a single policy is easy to set but hard to tune question by question |
| Cache size limit | Maximum size of the cached result stored for each saved question, set by MB_QUERY_CACHING_MAX_KB (default 2,000 KB) | Questions that return small aggregates and should always be cached in full | Large result sets are not cached at all if they exceed the limit, so the warehouse still runs them every time; confirm the limit in your version |
Cache size limits with MB_QUERY_CACHING_MAX_KB
The MB_QUERY_CACHING_MAX_KB environment variable sets the maximum cache size for each saved question, and its default is 2,000 KB. Metabase stores a cached result only if that result fits under the ceiling, so a question that returns a large result set can run on every view even when its caching policy looks correct on paper. Before you tune any duration or schedule, check whether the questions that feel slow are being cached at all. A dashboard that is set to cache for an hour will still hit the warehouse each time if its cards exceed the size limit.
Decide whether to raise the limit by starting with a short list of saved questions that are both heavy and widely viewed. Compare their result sizes with the 2,000 KB default, and confirm with the analysts who own them whether a trimmed column set or a summary aggregation would bring the result under the limit. Raising the ceiling globally affects every saved question, so it is usually better to first reshape the largest results. If you do raise it, record the new value in your configuration baseline and retest the affected dashboards, because the change applies to the whole instance rather than to one dashboard.
Confirm two consequences with your platform and database teams before you change the value. Cached results live in the application database, so a higher ceiling and more cached questions increase its storage growth and the size of its backups, which affects your restore window. Cached results are also loaded into the Metabase process when served, so larger entries can add memory pressure during peak viewing. Ask the team to measure application database size and JVM heap usage over a representative period after the change, and to set a retention or cleanup approach that matches the growth they observe.
How to set up caching policies in order
This sequence takes a self-hosted Metabase from an unplanned cache state to one where the slowest questions and dashboards use a deliberate caching policy, a size limit and a verified refresh schedule.
Confirm the application database and Metabase version
Before changing any caching setting, confirm which application database your instance uses and which Metabase version is running. Production instances should use PostgreSQL, as the application database documentation recommends, while an embedded H2 database is meant for demos. Check the version against the version support page so you know whether it is an LTS or non-LTS release and when it reaches end of life. Done means you have a written record of the database type and version, and you know the caching options you are working with on that release.
Identify the slow questions and dashboards
Have an admin list the saved questions and dashboards that users complain about or that take longest to load, and note how many cards each dashboard contains and how many people view it. Record the average execution time you observe for each query in the warehouse or Metabase logs, because adaptive caching uses that figure. Done means you have a short ranked list of the few objects worth caching, rather than a blanket setting for everything.
Choose a policy mode for each scope
Decide, for each question, dashboard and database, whether duration, schedule or adaptive caching fits the data. Duration caching keeps results for a fixed period, schedule caching refreshes results at set times such as before a morning review, and adaptive caching sets lifetime from execution time multiplied by a multiplier. Document the choice next to each object, along with the business reason for its freshness requirement. Done means every item on the ranked list has one mode and a stated freshness expectation.
Set the cache size limit with the environment variable
Set the maximum cache size per saved question using the MB_QUERY_CACHING_MAX_KB environment variable in your deployment configuration. The default is 2,000 KB, so decide whether wide or large results need a higher value and whether that increase fits your storage plan. Restart Metabase as your deployment method requires, then confirm the variable is loaded by checking the instance settings or startup configuration. Done means the value in effect matches the value you chose, and you can explain why it fits your largest cached results.
Enable caching and run a first refresh
Turn on caching for the objects from your choice list in the admin caching settings, then open each object once so its first result is stored. Check that the cache policy shows the mode you selected for each question, dashboard and database. If a schedule-based policy is in use, trigger or wait for its first run. Done means each cached object reports its configured policy, and no object is left on a mode you did not intend.
Verify cached results are served
Load a cached dashboard from a second browser session or user account, and compare the load time with the first view. A faster second view with the same result set indicates that the cached copy is being served. For adaptive caching, check that the lifetime shown in the policy matches execution time multiplied by the multiplier, using the documented example as a model. Done means at least one cached object returns faster on repeat views and its lifetime matches the expected value.
Confirm scheduled refresh runs and check permissions
Check that each schedule-based policy has run at its expected time by reviewing the cache or task history, and confirm the refresh produced fresh data. Then test a user without the right data permissions to confirm the refresh does not fail silently or expose results. Note any object where the refresh cannot run because of permission setups, and correct those settings before go-live. Done means every scheduled object has a recorded successful run and a documented permission result for a restricted user.
How a cached query request moves through Metabase
The walk starts when a viewer opens a dashboard card. Metabase checks whether a cached result exists for that question and its policy. On a hit, the stored result returns without touching the warehouse. On a miss, the query runs against the database, and the result is stored under the caching policy unless it exceeds the maximum cache size per saved question, in which case it is rejected and not stored. A refresh schedule path re-runs queries on its own timetable, so check both the policy and the size limit before expecting a fast dashboard.
Cache hit, cache miss, size rejection and scheduled refresh paths in Metabase.
Permission setups that block cache refresh
Permissions can stop a cache refresh before it starts, and the failure is often silent. Metabase runs a scheduled or automatic refresh by executing the question or dashboard query against the database connection under the account Metabase uses for that database. If that account lacks read access to the tables, schemas or views behind a cached question, the refresh fails and the cache keeps its previous results or stays empty. Check this in the database connection settings and in the database's own grants, because a connection that works for an administrator's interactive test may not have the same privileges as the service account Metabase uses in production.
A second setup problem is user-scoped data access. When a group has row-level or column-level permissions, or when sandboxing or attribute-based filters make a query return different results for each viewer, cached results can no longer be shared safely across people. Depending on how your instance is configured, Metabase may not refresh or store one cache entry that serves every viewer, so the caching benefit you planned may not appear for those questions. Row and column level permissions are a paid feature, so confirm which plan your organization uses before you design around them, using the Metabase pricing page as the starting point.
Test refresh under the account Metabase actually uses, not under an administrator login. For each cached question and dashboard, trigger a refresh, confirm the stored result updates, and check the logs for permission errors. Review data permissions alongside your caching policy in the same change, because a permission change can quietly disable a cache that a dashboard depends on. Write down which groups are expected to share cached results and which need live queries, and retest after any change to group membership, database grants or sandboxing rules.
Security and operational risks of cached results
Caching makes dashboards faster by keeping copies of query results, and those copies carry their own risks. The cards below cover who can see cached data, how old it may be, how fast the cache grows, and how row and column permissions interact with caching.
Cached results can cross permission boundaries
A cached result is stored once and served to anyone who can open the question or dashboard, so a user who would be blocked from running the query directly may still see its output. Check whether your caching setup serves results that were produced under a different user's data permissions. Test with a restricted account on every cached dashboard before enabling caching for it, and confirm the behavior against the caching documentation for your version.
Caching docsRow and column permissions need separate review
Row-level and column-level permissions change what a query returns for each user, so a single cached result may not match what every viewer should see. Before caching any question built on a permissioned table, list the groups that query it and confirm how each group's restrictions apply to the cached output. Where the answer is unclear, keep caching off for that content until the test passes.
Stale data reaching decision makers
A cache that refreshes on a long duration can show figures from hours or days earlier without any visible sign that they are old. Executives reading a dashboard may treat stale numbers as current, especially during month-end close or incident response. Show the last refresh time on critical dashboards, and set a refresh interval that matches how often the business changes the underlying data.
Cache growth in the application database
Cached results are stored in the application database, so many large questions can grow it faster than expected. Each saved question has a per-question size ceiling that limits how much a single cache entry can hold. Review the MB_QUERY_CACHING_MAX_KB setting, decide whether the default fits your largest result sets, and monitor application database size after caching is enabled.
- Default cache size limit
- 2,000 KB
Adaptive lifetimes hide unpredictable refresh
Adaptive caching sets each cache lifetime from the query's average execution time, so slow queries stay cached longer and fast ones refresh often. That behavior is hard to predict when query runtimes change after a warehouse upgrade or new data volume. Review cache lifetimes after major data growth, and record which content uses adaptive settings so the team can explain freshness to stakeholders.
Refresh blocked by permission setups
Automatic refresh runs queries on a schedule using a configured account, and that account's permissions decide whether the refresh succeeds. If the account loses access to a table or a group changes, the cache can silently stop updating while still serving old results. Assign a dedicated service account with the minimum read access needed, and check refresh status after any permission change.
Caching policy questions buyers ask before hiring help
What drives the effort of a Metabase caching rollout?
The main driver is how many questions, dashboards and databases need a caching policy, and how many of them have different freshness needs. A small instance with a few dashboards that all tolerate the same delay is a short exercise. An instance with dozens of dashboards, embedded analytics, and warehouses with different load profiles takes longer because each group needs its own duration, schedule or adaptive policy, tested against real viewing patterns. Cache size limits, the permission setups that block refresh, and the number of distinct warehouse owners you must coordinate with also add work. Ask any partner to base the quote on a written inventory of dashboards and their refresh expectations rather than a general estimate.
Can our team configure Metabase caching without outside help?
Yes, in most cases. Caching is set in the Metabase admin settings per question, dashboard and database, and a team with a Metabase administrator and a clear list of freshness requirements can make those changes directly. Outside help usually adds value in three places: deciding which policy fits each workload, checking that the chosen settings do not hide stale data from decision-makers, and verifying that refresh jobs run under the right credentials. If your team already runs Metabase in production and has someone who understands the warehouse, the work is often manageable internally.
What does the work need from our side?
Plan to provide administrator access to the Metabase instance, read access to the relevant warehouse schemas for testing, and an inventory of dashboards and saved questions with their owners and expected update frequency. You will also need to name the people who can approve freshness trade-offs, such as a finance team that needs daily figures or an operations team that needs near-real-time data. Warehouse owners should confirm which query loads are acceptable during refresh windows. Ask a partner to list these inputs in the scope document so that delays from missing access or unclear owners are visible before work starts.
How long does testing take for a caching policy change?
Testing time depends on scope: the number of dashboards and questions covered, how many databases they query, and whether embedded dashboards with many viewers are included. A limited change to one database can be tested in a short cycle. A broader change should include a baseline measurement before caching is enabled, a period of observation after it is enabled, and checks that cached results match what users expect. Confirm the duration and test plan with any partner in writing, and ask how they will measure the effect on warehouse load, since that is the reason most teams adopt caching.
Does a paid Metabase plan change the permission setup for caching?
It can. According to the Metabase pricing page, row and column level permissions, SSO and usage analytics and auditing are included only in the Pro and Enterprise plans, not in Open Source or Starter. If your caching design depends on different users seeing different rows or columns, the cached results must respect those permissions, and the open source edition may not give you the controls you need. Check which plan provides the access model you require before designing cache policies around it, and confirm the current plan details on the pricing page because they can change.
Which permission setups can block cache refresh?
Refresh jobs run with the credentials and access of the configured database connection, so a connection that lacks read rights to a schema, or a permission change made after caching was set, can stop scheduled refreshes without an obvious error on the dashboard. Teams also run into trouble when a database connection is used by several groups with different data restrictions, because the refresh behavior must match the most restrictive intent. Test refresh under the service account you intend to use, and review group and data permissions after each change. The Metabase people and groups documentation is the natural starting point for this review.
How do we avoid caching stale data that decision-makers rely on?
Set the freshness policy per question or dashboard according to how quickly the business needs changes, and document the expected maximum age of each result where people can see it. Adaptive caching sets the cache lifetime from the query's execution time, so slow queries are held longer, which is useful for load but may suit reports that need current figures less than it suits others. Keep critical financial or compliance reports on a schedule or a short duration, and test that users can see when a result was last refreshed. Review the policy with the report owners before wider rollout.
How DeployOpen works on this
DeployOpen plans and implements Metabase query caching policies inside your own infrastructure, starting from which questions, dashboards and databases are slow and who needs fresh data. The work is scoped in writing before the build, so the caching choices, permissions and evidence are agreed up front.
How we scope
- Inventory the questions, dashboards and databases where caching would change load or freshness
- Map which groups and collections need cached results and which need live queries
- Agree cache mode per item: duration, schedule or adaptive, with the reasons written down
- Confirm cache size limits, the open source edition's options and any plan needed for the setup
How we build
- Configure duration, schedule or adaptive caching on the agreed questions, dashboards and databases
- Set the cache size limit and check permission setups that would block refresh for cached items
- Test cached and uncached views with the expected viewer groups and confirm refresh timing
- Document each caching decision alongside the refresh schedule it depends on
How we hand over
- Deliver a caching policy document listing each item, its mode, refresh rule and owner
- Provide a runbook for checking refresh failures and adjusting cache settings safely
- Walk your Metabase administrators through the configuration and the test results
- Record the configuration so your team can reproduce or review it later
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts
- Ongoing support, upgrades and continuous testing are available as a retainer
- Revisit caching settings when Metabase upgrades change behavior or new dashboards are added
- Quotes follow from the written scope, so ask for the cost components and recurring items

