Knowledge Drop

How to cache a dashboard

  • 5 April 2021
  • 5 replies
  • 2704 views

Userlevel 2

Last Tested: Apr 1, 2019
 

You have two options here.

Instant Dashboards

The first option is to use instant dashboards. With instant dashboards, dashboards display the previous run’s data while new queries are run in the background, letting information appear quickly. This is a labs feature. More information here.
 

LookML-level caching

The second option is to persist the explores that the dashboard's tiles are built on. This can be done in the LookML using datagroups with the 'persist_with' parameter or using the 'persist_for' LookML parameter. 'persist_with/for' can be defined for the entire model, or for individual explores.
Note: Instant dashboards need to be turned off for this method to work.
 

Which to choose?

The benefit to instant dashboards is that we can see old information while new information loads. Instant dashboards will always hit the database, so you can be sure you're looking at fresh data.

The benefit to datagroups is tighter control over your caching given that you know your ETL process. If there is no new data in the database, there's no reason to hit the database again. Datagroups prevent unnecessary queries to the database. Also, some might argue that instant dashboards are misleading because they show stale data at the same time as the new data loads, rather than just showing a loading screen.

 

This content is subject to limited support.                

 


5 replies

Userlevel 7
Badge

Last Tested: Apr 1, 2019
​​​
LookML-level caching


Note: Instant dashboards need to be turned off for this method to work.

 

Which to choose?

The benefit to instant dashboards is that we can see old information while new information loads. Instant dashboards will always hit the database, so you can be sure you're looking at fresh data.

 

This content is subject to limited support.                

 

Hi,

 

To clarify:

Instant dashboards will ALWAYS his the database if the old data is outdated??

What is outdated data for instant dashboards?


We are about to investigate and pull together a lot of stats on cache hit rates specifically for a certain dashboard - seems like I have found my answer as to why it runs again even though cached! This seems crazy to me that it can’t take results from cache at a whole instance level if this feature is on...and I can’t control the instant dashboard “cache”, or can I?


thanks!

Userlevel 7
Badge

@adina.katz hi, could you clarify my points above or share further info on this. Over the last few months we have been carefully looking into cache and have heard a few things from support which has confused us. If you know about rendered or rendering cache would you mind explaining that as well.

Thanks!

Userlevel 2

Hi @IanT , with Instant Dashboards enabled, any time a dashboard is opened, it will run the queries against the database. While the queries run against the database, the dashboard will display results from the previous run. 

So regardless of wether the previous run of the dashboard was 5 seconds ago or 5 hours ago, the dashboard queries will run against the database anytime the dashboard is loaded. 

 

Let me know if there is anything I can clarify!

Userlevel 7
Badge

Thanks @adina.katz, do you have any info about rendering or render cache?

I would also like to know more about rendering or render cahce

Reply