The Catalyst SDK provides put, get, and delete methods for the Cache service. You write a value to a named key with an optional TTL in seconds; after the TTL expires, the entry is automatically removed. Cache is shared across all running instances of your Catalyst project, so one function instance can write data that another instance reads in a subsequent request. Values can be strings or serialised JSON objects.
Use Cache when a function repeatedly needs data that changes infrequently, such as a list of active product SKUs, a GST rate table, or a set of configuration values fetched from the Datastore. Caching these for five to ten minutes dramatically reduces Datastore read operations and speeds up function response times. Indian SaaS teams with high request volumes use Catalyst Cache to keep function latency low during peak business hours without scaling up their Datastore plan.
Cache is volatile; all entries are lost if the Catalyst cache service restarts, so never use it as a primary data store. Always code defensively by checking whether a cache miss occurred and falling back to the Datastore. Choose TTL values carefully: too short and you lose the performance benefit; too long and functions may serve stale data after an update.
A Chennai-based B2B marketplace uses a Catalyst function to serve product pricing in response to buyer API calls. The pricing table in the Datastore has 5,000 rows updated once a day. The function caches the entire pricing map in Catalyst Cache with a 12-hour TTL. During peak hours, 95 percent of pricing requests are served from cache, reducing Datastore queries from 50,000 to under 3,000 per day and cutting function execution time by 80 milliseconds per call.
Catalyst Cache stores string values. To cache complex objects such as arrays or JSON maps, serialise them to a JSON string before writing to the cache and parse them back after reading. The Catalyst SDK’s cache methods accept and return strings, so this serialisation step is the developer’s responsibility.
No. Catalyst Cache is scoped to the environment (development or production) within a project. A cache entry written in the development environment is not visible in production, which prevents test data from interfering with live application behaviour.
Aaxonix is a certified Zoho implementation partner based in Pune. Architecture-first, no surprises.