Connectors make use of the caching component to make way for significant performance improvements by providing high-throughput APIs and Processes. The crucial purpose it is meant to serve is to avoid unnecessary calls to the back-end system for read/query scenarios. Caching the select query along with the result set enables the speedy execution of identical selects as the data is fetched from cached memory by preventing a duplication of select queries .
The primary reason for caching is to ensure fast data access thereby serving information to users without delay which enhances the performance of the custom skill. Caching helps to store a copy of the data in a cache so that future requests for that data can be served faster. When you trigger a select query and if it is unavailable in the cache it considers the query as a new one and traverses further through the stack to fetch from back end server.
In regard to availing this function while drawing data from external sources, we can set the time for the data to be stored in the cached version. If any request for the same information comes within the set span of time the real database will not be queried instead the data will be retrieved from cache. The maximum duration allowed within the Connector Configuration Setting for a queried data stored in cached memory is 30 days.
Practice judicious use of cached memory by choosing the data to be cached as well as its duration. It is important to assess whether the time to retain a data in the cache is worth the amount of space used.
⚠ Warning: To enhance user experience the data in cached memory should be accurate and up to date. Hence never cache data changes frequently or faster than your cache time to live.
To enjoy the tangible benefits of caching, ensure to cache more generic responses and not personalized responses as it is similar to the process of requesting information from the back-end server directly.