What is Caching?

Cached Queries are a way for you to build applications with charts and tables that load instantly. A common use case for caching is to prepare and pre-compute query results that are going to be embedded into live customer-facing dashboards

As a bonus, Cached Query and Cached Dataset pre-computations do not contribute to your per-project query rate limit.

How to Cache a Query

You can create a Cached Query right from the Explorer. To cache a query, go ahead and save the query first

Fig 1:  Press the button to "Save" the query.

Then, to cache your most important queries select the “Enable Caching” checkbox and enter a refresh rate.

Cached queries are automatically configured with a refresh_rate of every 4 hours, but can be set to a number between 1 and 24 hours. The more frequently a query is asked to refresh the more overall number of properties are scanned.

When was the Cached Query last run? 

To find out whether your query has successfully been cached, the Explorer will show you “Caching is enabled” and lets you know when the query was last computed. 

Programmatic Use of Saved and Cached Queries

Everything we've accomplished here via the Explorer and more can also be done via the Keen API directly. See our detailed API reference documentation on here for examples and code samples.

Did this answer your question?