Product Documentation

Directing Policy Hits to the Cache Instead of the Origin

Feb 13, 2017

By default, when a request matches a policy, the NetScaler appliance forwards the request either to the origin server directly, or to a load balancing virtual server for the origin, depending on how you have configured cache redirection.

You can change the default behavior so that when a request matches a policy, the request is forwarded to a load balancing virtual server for the cache.

To change the destination for a policy hit to the origin or the cache, use the onPolicyMatch parameter, which specifies where to send requests that match the cache redirection policy.

The valid options are:

  1. CACHE - Directs all matching requests to the cache.
  2. ORIGIN - Directs all matching requests to the origin server.
Note: For this option to work, you must select the cacheredirection type as POLICY.

Possible values: CACHE, ORIGIN

Default value: ORIGIN

To change the destination for a policy hit to the origin or the cache by using the command line interface

At the command prompt, type the following commands to change the destination for a policy hit and verify the configuration:

  • set cr vserver <name> [-onPolicyMatch (ORIGIN | CACHE)]
  • show cr vserver <name>

Example

 
> set cr vserver Vserver-CRD-1 -onPolicyMatch CACHE 
 Done 
> show cr vserver Vserver-CRD-1 
        Vserver-CRD-1 (*:80) - HTTP     Type: CONTENT 
        State: UP  ARP:DISABLED 
        Client Idle Timeout: 180 sec 
        Down state flush: ENABLED 
        Disable Primary Vserver On Down : DISABLED 
        Default:        Content Precedence: URL Cache: TRANSPARENT 
        On Policy Match: CACHE  L2Conn: OFF     OriginUSIP: OFF 
        Redirect: POLICY        Reuse: ON       Via: ON ARP: OFF 
 
1)      Cache bypass  Policy: bypass-cache-control 
2)      Cache bypass  Policy: Policy-CRD 
 Done 

To change the destination for a policy hit to the origin or the cache by using the configuration utility

  1. Navigate to Traffic Management > Cache Redirection > Virtual Servers.
  2. In the details pane, select the virtual server for which you want to change the destination for a policy hit, (for example, Vserver-CRD-1), and then click Open.
  3. In Configure Virtual Server (Cache Redirection) dialog box, click Advanced tab.
  4. Select CACHE or ORIGIN from the Redirect To drop-down list.
  5. Click OK.