1

I have the following problem: we have a few dashboards in Looker that we use for customer presentations. One of them takes 5 minutes to load if not cached before. I would like this dashboard to be automatically cached by Looker in the background, so we don't have to wait along with the client. It wouldn't hurt if the results displayed are a few hours old.

In my research, I found that there was once a solution that might have met my needs called "instant dashboards" https://help.looker.com/hc/en-us/articles/4420192365075-How-to-cache-a-dashboard-Community- However, this no longer seems to be maintained by Looker and only works with legacy dashboards. For some reason there is only information about this in the german documentation: https://cloud.google.com/looker/docs/admin-panel-general-labs?hl=de#instant_dashboards

Another option I found is the "automatically refresh dashboard" feature that you can set when editing a dashboard. But that only works as long as the dashboard is open in a tab.

Now, we could set up a VM that keeps the dashboard open in a tab all the time - but that seems a bit overkill. Does anyone have any ideas for a better solution to this problem?

jlshns
  • 21
  • 3
  • I too just realized this auto-refresh doesn't work (I guess unless the dash is open in a tab) -- thanks for the tip. Hope someone has an answer. – user45867 Jun 21 '23 at 14:46

1 Answers1

0

In the model file, you can define a cache policy to control how often Looker should refresh the data for a particular explore. For example, let's say we want to refresh it every hour:

datagroup: default_datagroup {
  ## sql_trigger: SELECT MAX(id) FROM etl_log;;
  max_cache_age: "1 hour"
}

The above code defines a datagroup named "default_datagroup." The sql_trigger parameter specifies the SQL query that Looker will use to determine whether the data has changed and needs to be refreshed. In this case, we are not using it (commented part). The max_cache_age parameter is set to "1 hour," indicating that Looker should refresh the data in the cache for this explore at most every hour.

Then, at the explore level, you need to specify which datagroup (cache policy) should be used for that explore:

explore: your_explore_name {
  # Explore configuration
  persist_with: default_datagroup
}
Anita Hb
  • 118
  • 7
  • I do know about datagroups and we're also using them already. And they work as expected - If a query ran once it does not pull new data from the DB as long as the cache is valid. But my question is on a different issue. I want to cache a whole dashboard (in the background) so that it does not need to run all querys once it is opened for the first time every day. Like you can do it with PDTs. – jlshns Jul 21 '23 at 07:11