How to Cache httpCallout Responses in a NetScaler Appliance

How to Cache httpCallout Responses in a NetScaler Appliance

book

Article ID: CTX124718

calendar_today

Updated On:

Description

This article describes how to cache httpCallout responses. It is possible to cache callout responses on the NetScaler appliance using the Integrated Caching module.

Background

An HTTP callout is an HTTP request that the NetScaler appliance generates and sends to an external application when specific conditions are evaluated as true during policy evaluation. Advanced policy expressions analyze the information retrieved from the server and you can perform appropriate actions. You can configure HTTP callouts for HTTP content switching, TCP content switching, rewrite, responder, and for the token-based method of load balancing.

Instructions

Callout requests are always initiated with the source IP address of MIP or SNIP from within the NetScaler appliance. When the requests reach the virtual server, the NetScaler appliance identifies the request as the client IP address and this makes it easy for the appliance to distinguish between callout and non-callout requests.

Note: In this procedure, the callout server is a load balancing virtual server on the NetScaler appliance.

  1. You can have a simple policy like the following:
    add cache policy Cache_callout -rule "CLIENT.IP.SRC.EQ(127.128.129.130 )" -action CACHE -storeInGroup DEFAULT

  2. Ensure that you bind the cache policy either to the load balancing virtual server or cache global.
    For example,
    bind lb vserver test -policyName Cache_callout -priority 90 -gotoPriorityExpression END -type REQUEST
    Or
    bind cache global Cache_callout -priority 100 -gotoPriorityExpression END -type REQ_DEFAULT

Issue/Introduction

This article describes how to Cache httpCallout responses.

Additional Information

Verify using the following command:

Show cache object –locator <0x…>

If the object is stored as a callout response, the object properties displays the following:
      HTTP callout cell: YES
      HTTP callout name: test
      HTTP callout type: NUM
      HTTP callout response: 1201