Overview of the various caching options in Spotfire

Overview of the various caching options in Spotfire

book

Article ID: KB0070430

calendar_today

Updated On:

Products Versions
Spotfire Analyst 7.5 and higher
Spotfire Automation Services 7.5 and higher

Description

This article describes various caching options in Spotfire.

Issue/Introduction

This article describes various caching options in Spotfire

Resolution

The primary benefit of caching data or analysis is to speed up the process of loading the analysis at the user's end. Caching data will also avoid querying the database every time a user opens the dashboard which decreases the load. Caching analysis can reduce the wait time to even load cached data. Consideration should be taken when one is caching data that needs to be personalized. The method in this KB article 000019929 How to setup caching for reports with personalized information links with row level security can be used to help personalize cached data in Scheduled Updates.

Here are multiple options for caching data in Spotfire and a description of their individual use cases.

Option 1: Caching Data and Analyses on the Spotfire Web Player

Pre-requisites:
- Spotfire Web Player > Scheduled Updates
 
Details:
If the analysis will be accessed in the Spotfire Web Player, Scheduled Updates can be used to load the report during a given schedule. It will be retained in the RAM (and optionally the disk cache) and all requests will only use that cached version while that schedule is active. This way the SQL execution only needs to be run once at the start of the schedule.
Reference: https://docs.tibco.com/pub/spotfire_server/latest/doc/html/TIB_sfire_server_tsas_admin_help/server/topics/scheduled_updates_to_analyses.html

Disk Caching can also be enabled while scheduling caching of an analysis. By default, disk caching is disabled and can be enabled from Spotfire.Dxp.Worker.Web.Config file by setting enabled="true".
<cacheSettings enabled="false" path="" maxDiskSizeMb="0" maxAgeMinutes="1440"/>​

Reference: https://docs.tibco.com/pub/spotfire_server/latest/doc/html/TIB_sfire_server_tsas_admin_help/server/topics/enabling_cached_and_precomputed_data_for_scheduled_update_files.html

By default, "Allow caching" option for disk caching is checked for all analysis while creating rules (Create Rule > File > Additional Properties at extreme bottom left as shown in screenshot). Specific analysis can be excluded from disk caching by unchecking "Allow caching" option. 

Disk Caching acts as a recovery cache so that whenever your Spotfire Web Player undergoes a restart, the cache present in the disk will be used across all Spotfire Web Player services on same node. If cache needs to be used across multiple Spotfire Web Player nodes, shared disk needs to be used. Note: Disk caching does not decrease the RAM requirement for Scheduled updates
See "How Disk Caching works in Spotfire" for more details

SBDF Caching enables in-memory cache of Geo Coding tables which leads to faster creation and sharing of map chart visualizations on Spotfire Web Player and quickly open SBDF files from the library, it is possible to cache and preload the SBDF files stored in the library. The default query picks up only geo-coding tables but it is possible to configure it to cache other files as well. If files have not been accessed for a specified time, or if memory is low, they will be removed from memory. This can be updated in the Spotfire.Dxp.Worker.Web.config file here:

<sbdfCache enabled="true" cacheTimeoutMinutes="30" />
 <preloadSettings enabled="true" libraryCheckIntervalMinutes="10" librarySearch="MapChart.IsGeocodingTable::true AND MapChart.IsGeocodingEnabled::true" />
</sbdfCache>

Reference: https://docs.tibco.com/pub/spotfire_server/latest/doc/html/TIB_sfire_server_tsas_admin_help/server/topics/spotfire.dxp.worker.web.config_file.html

 

Option 2: Caching data in the Spotfire Analyst client

Pre-requisites:
- Spotfire Analyst
- Spotfire Automation Services
- Windows Task Scheduler or other scheduling application if job scheduling is needed

Details: 
See KB: 000035388 Caching data in Spotfire Analyst for full details of caching options in the Spotfire Analyst client.

Cons:

  • Saving the analysis as embedded (dxp) or the data (SBDF) in the library may be challenging if the data is larger than 2GB and if the Spotfire application database is on a Microsoft SQL Server (see KB 000028303 Size limit of items stored in the Spotfire Library for more details)
  • Spotfire Automation services job setup and schedule will be required for some configurations

 

Option 3: Caching data through Information Links

Pre-requisites:
-  Spotfire Analyst > Information Designer
- Setting Cache expiry time in Spotfire server > Attachment Manager
-  Spotfire WebPlayer > Scheduled Updates
- Spotfire Automation Services
- Windows Task Scheduler or other scheduling application if job scheduling is needed
 
Details:
See KB: 000035390 Caching data through Information links for full details of caching options using Information Links.
 
Cons:

  • Whenever Spotfire Server is restarted, Information link cache will expire and need to be re-cached again
  • Information link caching option is not useable in case of a clustered Spotfire Servers because Information link caching needs to be done on each Spotfire server, the cache is not shared across servers. Opening analysis on Spotfire Web Player or Spotfire Automation Services connecting to specific Spotfire server will not guarantee caching Information link on that particular server as Node Manager services can cache Information link data on any Spotfire servers or sometimes all. This may sometimes result in cached data being out of sync. However, opening dashboard manually connecting to each Spotfire server through Spotfire Analyst will create Information link cache on each server.
  • Spotfire attachment manager caches library content and the results of information link executions when downloading or saving large amounts of data. If cache expiration time in Attachment Manager is extended to a week, then other contents will also not be cleaned up till a week and temp folder will start occupying more disk space
  • Multiple dashboards using same Information link should not be run at the same time otherwise all the dashboards will try to cache the same Information link multiple times. If data volume retrieved by that Information link is huge, disk space can also be exhausted and it will also impact your database performance as same query is running multiple times simultaneously. Let one dashboard cache the Information link completely and then trigger rest of the dashboards so they will use the Information link cache

 

Option 4: Caching data through Data Connection

Pre-requisites:
- Spotfire Analyst > Data Connection
 
Details:
Data connection caching is done on Spotfire Web Player service level to speed up loading of dashboards and avoid hitting the database every time by all users. In case of multiple Spotfire Web Player services, data connection caching needs to be done on individual Web Player services either manually or using Scheduled Updates.
Open the dashboard containing data connection to be cached, individually on each Spotfire Web Player instance manually. So the data connection will get cached and all users opening the dashboard will get cached data. Data will remain cached till its expiry set date time. Once data connection cached is expired, the first time when the dashboard is opened it will fetch new data and again cache it till the mentioned expiry date. On Spotfire Analyst, data connection cache will be preserved only while the session is active.

Cons:

Additional Information

KB: How Disk Caching works in Spotfire KB: 000019929 How to setup caching for reports with personalized information links with row level security Doc: Manually editing the service configuration files Doc: Details on Data Connection KB: 000035388 Caching data in Spotfire Analyst KB: 000035390 Caching data through Information links KB: 000034774 How to manually refresh the data connection cache on Spotfire Web player when caching settings are done through data connections  KB: 000034143 Cache expiration time precedence in Attachment Manager (from Spotfire Server Configuration Tool > Configuration Tab) to that of the Information Link cache settings KB: 000033500 Disk cache incorrectly treated as out of date and not used to reload data due to un-synchronized system clocks

Attachments

Overview of the various caching options in Spotfire get_app