Docs
Caching

Caching

By default, query results are cached in Hashboard for four hours, but this is configurable for each data model with the Time To Live (TTL) configuration.

What is the caching Time To Live (TTL)?

Once a query is run from Hashboard, the results are stored in an in-memory cache on our servers so that users don't have to access the database again for the same query. The Time To Live (TTL) setting allows you to control how long Hashboard uses that stored data before executing the query again.

If you leave the TTL configuration blank, we will default the TTL for this data model to 4 hours.

If you set this to 1, then the cache will effectively be disabled (data will only be retained for one second).

Local cache— Hashboard keeps a copy of cached data in your web browser while you are logged in so that exploring data feels incredibly fast. The above caching rules also apply to this local browser cache. If you make make the caching Time To Live very short, it may make normal operations like filtering and removing a filter feel slow.

Changing caching Time To Live (TTL)

  1. Go to the data models page (opens in a new tab).
  2. Click the edit button for the data model you want to update.
  3. Open ⚙️ Advanced Settings via the ... menu in the top right.
  4. Change the Cache TTL.

Bypassing the cache

When viewing a saved exploration, you may want to fetch fresh data instead of using the cache.

You can bypass the query cache by using the Refresh Data button, found in the dropdown menu in the upper-right corner when viewing a saved exploration. This action is also accessible from the same dropdown menu in the Data Explorer and the clickable "refresh" icon found next to Data fetched at <time> at the top of the explorer.

Clearing the cache for a model

Sometimes, you may know that the data a model uses has changed before Hashboard does. For example, after running an updated DBT pipeline. While you could just wait for the cache to expire (based on the TTL setting above), you can also immediately clear the cache for a given model.

You can reset the model's cache using the Hashboard CLI:

hb cache clear m:MODEL_ID

Alternatively, you can reset the model's cache in the UI:

  1. Go to the data models page (opens in a new tab).
  2. Click the edit button for the data model you want to update.
  3. Open ⚙️ Advanced Settings via the ... menu in the top right.
  4. Click the remove all cached queries button beside the TTL input.