Store and reuse frequently called data.
Use a Cache scope to reduce the processing load on the Mule instance and to increase the speed of message processing within a flow. The component is particularly effective for these tasks:
When a message processor in a Mule app sends a message to the Cache scope, the parent flow expects an output. The Cache scope processes the message payload, delivers the output to the parent flow, and saves the output (that is, caches the response). The next time the Cache scope receives the same kind of message payload, the scope can produce a cached response rather than invoking a potentially time-consuming process again.
For instance, you can use a Cache scope to manage customer requests for flight information. Many customers might request the same pricing information about flights from San Francisco to Buenos Aires. Rather than using a lot of processing power to send separate requests to several airline databases with each customer query, you can use a Cache scope to schedule periodic requests to airline databases and present users with the cached prices. When the timeliness of data is not critical, Cache scope can save time and processing power.
Put any number of message processors (such as connectors or components) into a Cache scope and configure the caching strategy to store the responses (which contain the payload of the response message) produced by the processing that occurs within the scope.
The cache scope also works in clustered environments because the object store configured in the caching strategy is shared across all nodes in the cluster.