Result caching is a OSB feature to cache business service response for a given request.
OSB uses Coherence to support caching, if we enable caching g in correct way then it will increases applications performance.
When cache is enabled , if a request comes to the business service then it will first check in the cache and returns the output to the caller otherwise it will call the target service and get the output and and return it to the caller and store it in cache again.
The result caching mechanism that Oracle Service Bus uses is Oracle Coherence (Enterprise Edition), which is included with Oracle WebLogic Server.
Result caching works only with request/response operations.
For setting up the Result caching , open the business service and go to “Message Handling Configuration”
Expand Advanced Settings and in Result Caching select Supported.
Set the Cache Token Expression: fn:data($body/tar:result/custinfo)
This will use the customer info as our unique token for the cache entry. Also, set the Expiration Time for 10 seconds.
Click Last >> and Save to confirm the Business Service modifications. You can activate the change session.
Now click Launch Test Console for CustInfoPS proxy service and let’s test our configurations.
For first time you execute the service, it will take nine seconds to execute and it will populate our cache entry. Click Back in the Test Console and try to execute again; it will show the results immediately, directly from a cache entry in the embedded Oracle Coherence Server running within Oracle Service Bus.