How do I keep queries fresh in the background

I've built a metrics dashboard in retool that queries a Postgres backend. It's queries need to be refreshed infrequently (1x per day). I have configured the query results to be cached, and when they are, all is well. However, when the cache expires, the next time I hit the dashboard, it fires a ton of really expensive queries off. Any of these individually can be handled within the 120s timeout duration, but all together they overload the DB and the dashboard breaks.

Is there a way to stagger the requests and run them in the background, even when no one is looking at the dashboard? (I'm aware of the Page Load Delay and Period Interval functions - these are cool, but don't solve the problem when no one has looked at the page for a while).

Apologies if this has already been asked...

Hi @doug! Great question.

We're working on a new scheduled queries feature that will likely help with your use case, but it hasn't been released yet. Keep an eye on our updates, as we'll be releasing a feature for scheduling queries to run even when no one has looked at the page.

In the meantime, you could try staggering the queries by triggering them on success of one another to help with performance:

Do you think that could work for you?

Hi Tess - thanks for the reply; the interim solution is definitely helpful, as it will prevent timeouts. However, it will also cause the page to take several minutes to load when it hasn't been loaded recently. I'll implement that for now but definitely count me as +1 for scheduled background queries.