![]() |
Copyright © Cloud Software Group, Inc. All Rights Reserved |
TIBCO API Exchange Gateway can cache response messages from the target services. The response caching functionality is supported for HTTP(s)/REST and HTTP(s)/SOAP requests. To enable caching of response messages from the target services for any facade operation, see Enable Response Caching.Response caching is supported by the CacheEnabled operation feature of TIBCO API Exchange Gateway. If the CacheEnabled keyword is specified in the Operation Feature and the caching is not explicitly configured on the Config UI for a facade operation, TIBCO API Exchange Gateway uses the default caching parameters as follows:
− Cache Type: Simple Cache
− Time To Live: 1 day (24 hours)The Facade Response Cache is known as Simple Cache. If the Simple Cache type is enabled as response caching for a facade operation, the Core Engine processes the incoming facade requests as follows:
• When the response message is received from the target service by the Core Engine for the first time, the Core Engine stores the response message including the headers in the cache using the cache response key. See Cache Response Key. For every subsequent requests from the client, the response from the cache is returned with all the response headers, similar to the response headers from the target service. The X-Cache: Hit in the response message header indicates that the response message is returned from the cache.
•
• If the HTTP header of the response message from the target service has a Cache Control header with either the no-cache or no-store directive, the response is not cached.
<h:header name="accept">
If the response caching of Improve SLA type is enabled for a facade operation, the Core Engine processes the incoming facade request as follows:
− For any request from the client, if the response from the target service is not received within a configured time period specified by the Short Wait Timer parameter, the Core Engine fetches the response message stored in the cache.
• Accept-Header: The Accept HTTP request-header may be used to pass a content-type preference to the target service. For example, a service may support an Accept-Header of application/xml or application/json to preferentially return the response message in XML or JSON format. For the purpose of caching, the request with Accept-Header of application/xml or application/json are managed as two separate requests. The Accept-Header is added to the cache response key as an additional discriminator.For example, if a user requests the JSON data for a URI such as /Books/BookOperations/Title/Power , the cached response is only returned if the cache value has a JSON response for that URI in the cache.
You can override the default cache response key using the custom XSLT specified in the parsing step of a facade operation request. See Override Cache Response Key and Parameters on how to create a cache response key using XSLT.For the Proxy operation feature of TIBCO API Exchange Gateway, the response caching is supported as follows:
• If the caching is explicitly configured for a facade operation on the Config UI, TIBCO API Exchange Gateway uses the Cache Type and other caching parameters such as Time To Live as configured for the facade operation.
− Cache Type: Simple Cache
− Time To Live: 1 day (24 hours)
4. Click the ROUTING tab on the right-hand side.
5. Click the Facade Operations tab.
7. Select the Enable Caching check box.
Table 159 Response Caching Parameters
• This parameter is not applicable for Simple Cache response caching type.The cached messages are deleted after the time specified by Time To Live parameter. Start the Cache Cleanup Agent to clear the cached response messages as follows:
1. Task A Create XSLT FileCreate an XSLT file with the following key types to specify the new values for the cache response. Refer to Sample XSLT File.
Table 160 Key Tags for XSLT File Task B Upload XSLT File
4. Click the ROUTING tab on the right-hand side.
5. Click the Facade Operations tab.
7.
If you copy the XSLT file to the ASG_CONFIG_HOME/ASGProjectConfig/xslt directory, select the XSLT file in the ProcessBody Transform field of the Facade Operations tab.
Out of the box, TIBCO API Exchange Gateway provides a BookQueryBE example. By default ,the queryBookByTitle facade operation is enabled for simple cache response type.
![]() |
Copyright © Cloud Software Group, Inc. All Rights Reserved |