Facade Response Cache (Simple Cache)

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:

  • The Core Engine retrieves the response message from the cache for the matching cache response key for every facade request from the client.
  • If the response message is found in the cache and is not expired, the Core Engine sends the response message from the cache as the facade response message to the client.
  • If the response message is not found in the cache, the Core Engine forwards the facade request to the target operation and sends the response message from the target service to the client. The Core Engine stores the response message into the cache just before sending the response message to the client. This ensures that the response message is available in the cache for subsequent requests from the client. The Time to Live parameter specifies the duration of the response message in the cache. See Response Caching Parameters table.
  • If the response message in the cache for the same cache response key is expired, the Core Engine deletes the response message from cache and forwards the facade request to the target operation.
  • 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 response from the target operation is an error, the Core Engine does not cache the response.
    Note:
    • When a response message is found in the cache for a facade operation request, the Core Engine adds the following header in the response message:

      X-Cache: Hit

    • 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.