Direct policy requests to cache instead of origin web server
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 request 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:
-
CACHE- Directs all matching requests to the cache. -
ORIGIN- Directs all matching requests to the origin server.
Note:
For this option to work, you must select the cache redirection type as
POLICY.
Possible values: CACHE, ORIGIN
Default value: ORIGIN
Change the destination for a policy request to the origin or the cache by using the CLI
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)]
<!--NeedCopy-->
show cr vserver <name>
<!--NeedCopy-->
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
<!--NeedCopy-->
Change the destination for a policy hit to the origin or the cache by using the GUI
- Navigate to Traffic Management > Cache Redirection > Virtual Servers.
- In the details pane, select the virtual server for which you want to change the destination for a policy request, (for example, Vserver-CRD-1), and then click Open.
- In the Configure Virtual Server (Cache Redirection) dialog box, click Advanced.
- Select CACHE or ORIGIN from the Redirect To drop-down list.
- Click OK.