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.

Cache redirection policies use two types of appliance expressions languages, classic and default syntax. For more information about these languages, see Policies and expressions.

Built-in classic cache redirection policies

Built-in cache redirection policies based on classic expressions are called classic cache redirection policies. For a complete description of classic expressions and how to configure them, see Policies and Expressions.

The classic cache redirection policies evaluate basic characteristics of traffic and other data. For example, classic cache redirection policies can determine whether an HTTP request or response contains a particular type of header or URL.

The NetScaler appliance provides the following built-in classic cache redirection policies:

Built-In Policy Name Description
bypass-non-get Bypass the cache if the request uses an HTTP method other than GET.
bypass-cache-control 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 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 Bypass the cache because the request is dynamic, as indicated by one of the following tokens in the URL: ?, !, or =.
bypass-cookie Bypass the cache for any URL that has a cookie header and an extension other than .gif or .jpg.

Built-in default syntax cache redirection policies

Built-in cache redirection policies based on default syntax expressions are called default syntax cache redirection policies. For a complete description of default syntax expressions and how to configure them, see Policies and Expressions.

In addition to the same types of evaluations done by classic cache redirection policies, default syntax 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 default syntax 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 default syntax cache redirection policy, you cannot modify the action.

The NetScaler appliance provides the following built-in default syntax 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)       Cache-By-Pass RULE: NS_NON_GET          Policy:bypass-non-get
2)       Cache-By-Pass RULE: (NS_CACHECONTROL_NOSTORE || NS_CACHECONTROL_NOCACHE || NS_HEADER_PRAGMA)    Policy:bypass-cache-control
3)       Cache-By-Pass RULE: (NS_EXT_CGI || NS_EXT_ASP || NS_EXT_EXE || NS_EXT_CFM || NS_EXT_EX || NS_EXT_SHTML || NS_EXT_HTX) || (NS_URL_PATH_CGIBIN || NS_URL_PATH_EXEC || NS_URL_PATH_BIN)         Policy:bypass-dynamic-url
4)       Cache-By-Pass RULE: NS_URL_TOKENS       Policy:bypass-urltokens
5)       Cache-By-Pass RULE: (NS_HEADER_COOKIE && NS_EXT_NOT_GIF && NS_EXT_NOT_JPEG)     Policy:bypass-cookie
 Done

Display the built-in cache redirection policies by using the GUI

  1. Navigate to Traffic Management > Cache Redirection > Policies. The configured cache redirection policies appear in the details pane.
  2. Select one of the configured policies to view details.