Tableau - Cache


Introduction

The Tableau Server caches query results, rendered dashboards, etc to improve performance. We use the default (up to 12 hours) to improve performance and cause the dashboard to load faster. Since most dashboards use extracts this isn't usually an issue. 

Instructions

Cache and Extracts

The server is configured to automatically "Warmup" the cache after an extract is refreshed. This allows it to display the newest data from the extract. 

 

Live Connections

The long cache life can be a problem when you are connecting directly to a database. Even if the database has been updated your dashboard might use cached information. Below are some ways to test and get the best fit. 

 

Ways to Avoid the Cache

1. Refresh Button

If you already have the dashboard loaded the refresh button (the one in the viz, not the browser) will tell Tableau to requery the datasource. 

Clicking the Refresh Button will trigger a re-query of the data

 

2. URL Flag

This is a simple way to make sure you aren't loading the cache by appending ?:refresh=yes to the end of your URL. This will tell the server to refresh the data. 

 

3. Set a Data Freshness Policy

This is feature was added in version 2022.1 and allows the workbook owner or project leader to set the cache to match the needs of the dashboard and data. This feature will only work with live database connections.
Details on Data Freshness Policy from Tableau
Important: This has replaced the older method of using no-cache and 1h-cache tags

 

Performance Impact

Cache is designed to improve performance and reduce load on the Tableau Server and underlying databases. When setting a Data Freshness Policy you will need to balance the need for updated information with 

Data Freshness Policies allow for:

  • Default of 12 hours.
  • Ensuring the data is fresh every X minutes/hours/days.
  • Ensuring the data is fresh at a specific time. 
  • Always live. We do not reccomend usign this option since every time a user views a dashboard multiple Tableau will send multiple queries to the database. Instead workbook owners should use a policy of Ensure Data is Fresh every 5 minutes.  

 

4. Use the Auto-Refresh Dashboard Extension

If you are making a dashboard that will be open on a TV or open and updated consider using the Auto-Refresh Plugin. At intervals of every 5+ minutes, it will re-query the data and re-render your dashboard with less load than a browser refresh. Very handy if the dashboard is open on a TV. 

Every browser with the dashboard open will refresh the data seperately and generate load so have two copies. Use the extension on a display version that is seperate from what most users have access to.