Question

Pre-cache a dashboard?

  • 4 January 2018
  • 8 replies
  • 1480 views

Hi. I want users to click into data on my dashboards.



But, I find that they often give up because the load times so long. Can I set it so that it runs every drill-down query when it refreshes the dashboard?



Thanks,


Sebastian


8 replies

Instead of caching every drill down, a PDT might be the alternative solution to get the speed you are looking for

The dashboard pulls from data stored in a PDT.

Hey @sebastian there’s no simple way to have cache “warmed” with every potential drill-down. If you could visit help.looker.com with a few more details as to how this would work in your instance I’d be happy to pass this information along to our product team.

I suspect you could use the looker API to do this. If you set up a cron-job that hits all of the relevant looks with the drill downs every morning and set the caching rules appropriately I think you could make this happen.

Can anyone confirm that this works with the API?



If we make a request with cached=True does that actually cause it to cache the result from that request (if not already cached)?

Userlevel 1

Hi @jamesmcm, the making the request with cache = True tells the but whether to use cached results if available or not:



cache=true : use cache if it is available


cache=false : don't use cache even if it is available


cache_only=true : retrieve any results from cache even if the results have expired



However, these endpoints do not set the cache.

So is there an API call that can set the cache?

Userlevel 3

Hi James,



Yeah, precaching a dashboard can be done with the API, there’s a good outline of how to accomplish this here: Prefetching (3.36+)



However, we generally recommend using datagroups and schedules for this job, since it guarantees the filters will be the ones used by the dashboard. https://docs.looker.com/data-modeling/learning-lookml/caching#specifying_caching_policies_with_datagroup_parameters

Reply