Improve Performance Using Caching

When working with data-bound page elements, such as data repeaters, data tables, and data functions, you can improve the performance and page rendering of your website using caching. Caching controls how often a page containing a data connection requests data from Salesforce.

Required Editions

Available in: Salesforce Classic

Available for purchase in: Enterprise, Performance, and Unlimited Editions

Available (with limitations) in: Developer Edition

Lets say 100 people visit the site page at the same time. Without caching, the page makes 100 separate requests for the same data, slowing performance considerably. However, with caching enabled, the data is requested and retrieved only once—the first time someone visits the page. Any subsequent requests for data during a set time period are returned from the cache. When the specified time period expires, the cache is refreshed.

The Cache Duration (Minutes) field in the Properties tab controls the length of time to cache retrieved data for the selected data repeater, data table, or data function.

The default value is 30 minutes. However, the appropriate number of minutes depends on your requirements. For example:

  • If the data is updated frequently, such as in a commenting system or a stock ticker, you can disable caching by setting the value to zero to ensure the freshest data displays on the page.
  • If the data changes infrequently, say just once a week, you can set the value to a much greater number of minutes. A longer caching period also helps ensure pages can display data even if the data source is momentarily unavailable.
Note
Note Whenever updates to a site are published, the cache is deleted for all data connections. Caching begins again the next time a site visitor accesses the page.