I have been working recently in an integration project as a MuleSoft Developer. We have used many different technologies like Alfresco, Drupal, other external services... and we have implemented a large amount of APIs to support the integration between all the systems.

As the APIs were getting bigger, we've been experimenting with some performance issues.

Using cache has been one of many decisions that we have made to improve the performance in our project.

About caching in MuleSoft:

The Cache Scope saves on time and processing load by storing and reusing frequently called data. You can put any number of message processors 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.

Configuring Cache Strategy

 

Define the Custom Object Store (EhCacheObjectStore)

 

 

Add Cache to the flow

Add the tag <ee:cache> to the flows that take a long time to be proccessed and they are not expected to change in a short period of time

 


Invalidate Cache

If we add cache to GET:properties method, we will need to invalidate the cache every time we update a property

Read Next
Steering Career Progression in the Right Direction

Steering Career Progression in the Right Direction

03 November, 2016|4 min