Built-in cache redirection policies
The NetScaler appliance provides built-in cache redirection policies that handle typical cache requests. These policies are based on HTTP methods, the URL or URL tokens of the incoming request, the HTTP version, or the HTTP headers and their values in the request.
Built-in cache redirection policies can be directly bound to a virtual server and do not need further configuration.
Built-in Advanced policy cache redirection policies
Built-in cache redirection policies based on Advanced policy expressions are called Advanced policy cache redirection policies. For a complete description of Advanced policy expressions and how to configure them, see Policies and Expressions.
In addition to the same types of evaluations done by classic cache redirection policies, Advanced policy cache redirection policies enable you to analyze more data (for example, the body of an HTTP request) and to configure more operations in the policy rule (for example, directing the request to either cache or origin server).
NetScaler appliances provide the following two built-in actions for the Advanced policy cache redirection policies:
- CACHE
- ORIGIN
As implied by their names, they direct the request to the cache server or the origin server, respectively.
Note: If you are using the built-in Advanced policy cache redirection policy, you cannot modify the action.
The NetScaler appliance provides the following built-in Advanced policy cache redirection policies:
Built-In Policy Name | Description |
---|---|
bypass-non-get_adv | Bypass the cache if the request uses an HTTP method other than GET. |
bypass-cache-control_adv | Bypass the cache if the request header contains a Cache-Control: no-cache or Cache-Control: no-store header, or if the HTTP request contains a pragma header. |
bypass-dynamic-url_adv | Bypass the cache if the URL suggests that the content is dynamic, as indicated by the presence of any of the following extensions: cgi, asp, exe, cfm, ex, shtml, or htx. Also bypass the cache if the URL starts with any of the following: /cgi-bin/, /bin/, or /exec/. |
bypass-urltokens_adv | Bypass the cache because the request is dynamic, as indicated by one of the following tokens in the URL: ?, !, or =. |
bypass-cookie_adv | Bypass the cache for any URL that has a cookie header and an extension other than .gif or .jpg. |
Display the built-in cache redirection policies
You can display the available cache redirection polices by using the command line interface or the configuration utility.
Display the built-in cache redirection policies by using the CLI
At the command prompt, type:
show cr policy [<policyName>]
Example:
> show cr policy
1)
Policy: bypass-non-get-adv Rule: HTTP.REQ.METHOD.EQ(GET).NOT Action: ORIGIN
Hits: 0
2)
Policy: bypass-cache-control-adv Rule: ((HTTP.REQ.CACHE_C0NTR0L.IS_N0_ST0RE) || (HTTP.REQ.CACHE_C0NTR0L.IS_NO_CACHE) || (HTTP.REQ.HEADER("Pragma").C0NTAINS("no-cache")))
ction : ORIGIN
Hits: 0
3)
Policy: bypass-dynamic-url-adv Rule: (HTTP.REQ.URL.ENDSWITH_ANY("ns_cr_dynamic_ext") || (HTTP.REQ.URL.PATH.STARTSWITH_ANY("ns_cr_dynamic_path"))) Action: ORIGIN
Hits: 0
4)
Policy: bypass-urltokens-adv Rule: HTTP.REQ.URL.REGEX_MATCH(re/[?!=]/) Action: ORIGIN
Hits: 0
5)
Policy: bypass-cookie-adv Rule: ((HTTP.REQ.HEADER("Cookie").EXISTS) && (!(HTTP.REQ.URL.ENDSWITH(".gif"))) && (!(HTTP.REQ.URL.ENDSWITH(".jpeg")))) Action: ORIGIN
Hits: 0
Done
<!--NeedCopy-->
Display the built-in cache redirection policies by using the GUI
- Navigate to Traffic Management > Cache Redirection > Policies. The configured cache redirection policies appear in the details pane.
- Select one of the configured policies to view details.