Disable Query Result Caching

Hi All,
I’m using Redash with a custom connector to query a data source where I want to force a user to perform the query each time they want to view results, and that they can’t view results from queries performed by others. So in other words I’d really like Redash to act as a front end view only and will not store any query results at all. I’m currently using Redash 3.0.0 (yes, it’s super old I know!), but will upgrade if required.

What do you think? Is such a thing possible?

You won’t be able to completely rule out caching. Running a query is asynchronous: a worker gets the result and saves it to the metadata DB. The front-end waits for this to complete and then pulls the cached result from the metadatadb. You can’t stream the database result directly to the front-end without a major rewrite.

What you could do is modify the API handler to always include max_age: 0 in the API call for results. This way even the first visit to the query page will invoke a fresh execution. I’m not sure how you’d do it with Redash 3 but this can work in V7 or above (at least).

Another option is to update the API handler to delete the query result immediately the first time it is read.

Either way, you’ll modify the query_results endpoint.

1 Like