Result Cache vs Rendered Cache

Knowledge Drop

Last tested: Sep 6, 2019
 

1. Result cache is the results that came from the db with minimal post processing (this includes dimension fill but does not include formatting, drill fields, etc.) Result cache keys are created by hashing the SQL that generated them and a few other things including details about the connection.

2. Rendered cache is the fully post processed and serialized (e.g. JSONified) result which is ready to return to the client. The rendered cache key is created by hashing info about the LookML project digest, the connection details in the Admin - Connections panel, general instance settings, query request params (field, filters etc), relevant user attribute values for the user (if the query uses access filters, access grants, liquid, etc.), other user settings (locale if localization is used, user timezone if User-Specific Timezones is enabled, etc.), result format (e.g. different file types for downloads), Looker version, and dev/prod. Unlike the result cache key, the rendered cache key does not include the SQL.

Important things to note are:

  • If you want to set cache via a schedule, you need to use a render type (PDF, PNG, etc.) and the filters have to match exactly- this isn't an official use case so we don't guarantee it
  • When you run a query in the UI the render cache and result cache are both set. Same thing if you download a PNG/PDF.
  • When you download a CSV/ text file, only the result cache is set (i.e. when you navigate to the content it will still need to render- i.e. the CSV download didn't set the render cache).
  • The "from cache" phrase on a piece of content is referring to render cache. There isn't a way to know on the content itself whether the data came from result cache, the database cache, or neither.
  • Result cache can be shared for different result formats (csv, html, etc.).
  • Rendered cache is much faster to use as we do not need to generate the SQL to determine the cache key, nor do we need to do any postprocess work. However, it takes longer to create because it contains lots of info including the formatting.
  • Don't forget about database cache which it set on the DB itself.

This content is subject to limited support.                

Version history
Last update:
‎05-07-2021 09:09 AM
Updated by: