Hello!
Similar to this blog post I am looking for a way to trigger a cache refresh for my dashboard when a certain action happens. In my data, user's have the ability to update their dataset. When they do so, I am looking for a way to trigger the dashboard cache so that when they go to view the dashboard the data has been updated as soon as they update their dataset.
I don't want to have the auto-refresh option due to the likelihood of data performance issues, but I'm wondering if there is a neat way to do this via a datagroup argument or even an API call if possible. If anyone has any advice it would be greatly appreciated.
I've actually made a bit of progress on this by adding a datagroup that looks at a specified field and and adding this datagroup through my explore and updates based on the `sql_trigger` value.
My issue now is that the my sql_trigger value is checked every 5 minutes (the default by Looker). I tried to change the cron expression to every minute (*/1****) but it doesn't seem to update, each datagroup still takes 5 minutes for the regenerator to run. I did see in this blog post some more information on the regenerator and something that didn't make a whole lot of sense to me was this phrase:
Note: The `PDT And Datagroup Maintenance Schedule` setting will accept a cron string for a timeframe that is more frequent than every 5 minutes, however the regenerator will only run at most every 5 minutes.
Does this mean that this field will accept the "run every minute" cron expression, but won't actually run it every minute? And rather, running it every 5 minutes is the most frequent time frame the regenerator can run? Just wanted some clarity on this if anyone has used it. Thanks!
Hello,
Your understanding is correct, datagroups are checked every 5 minutes. You could either remove the cache entirely on these dashboards or build an API process in the background to refresh the cache for you (see: https://www.googlecloudcommunity.com/gc/Technical-Tips-Tricks/Can-I-cache-with-the-API-query-endpoin...). Hope this helps answer your question.