Technical data
Brocade ServerIron ADX Advanced Server Load Balancing Guide 81
53-1003441-01
Content-aware cache switching
2
Setting up the CSW policies
The CSW policies define selection criteria for URL strings and specify what happens when a URL
string matches the selection criteria. In content-aware cache switching, if an HTTP request contains
a URL string that matches a policy’s selection criteria, the HTTP request can be sent to a load
balanced cache server group or to another policy for additional matching.
NOTE
The CSW policies discussed in this section apply to the example in Figure 21 on page 79.
The following commands define a CSW policy called “p1”.
ServerIronADX(config)#csw-rule r1 url suffix “gif”
ServerIronADX(config)#csw-policy p1
ServerIronADX(config-csw-p1)#match r1 forward 1
ServerIronADX(config-csw-p1)#default forward 2
ServerIronADX(config-csw-p1)#exit
Syntax: csw-rule r1 url prefix | suffix | pattern" selection-criteria"
The csw-rule r1 url suffix gif command consists of two parts. The first part specifies what kind of
matching the policy does on the selection criteria. Three kinds of matching methods are supported:
• The prefix keyword compares the selection criteria to the beginning of the URL string.
• The suffix keyword compares the selection criteria to the end of the URL string.
• The pattern keyword looks for the selection criteria anywhere within the URL string.
The second part of the specifies the selection criteria, which can be up to 80 characters in length;
In this example, the selection criteria is the text string "gif". Because the matching method is suffix,
the policy looks at the end of the URL string. If the URL string ends with the text "gif", then the URL
string meets the selection criteria.
NOTE
In addition to using text as selection criteria, you can use an asterisk (*) as a wildcard character to
specify one or more characters at the end of a URL string. For example, using "/ho*" as the selection
criteria matches /home, /hotels, and /home/main/index.html.
If you are using the suffix matching method, you cannot use an asterisk (*) as a wildcard character.
The asterisk wildcard character is valid for the prefix and pattern matching methods only.
Syntax: csw-policy policy-name
The csw-policy p1 command sets the name of the policy.
Syntax: match r1 forward server-group-id
If the URL string meets the selection criteria, the second part of the match command specifies
what to do with the HTTP request. In this example, the 1 in the command causes the HTTP request
to be sent to the cache server group whose ID = 1. Specifying 0 in the match command causes the
request to be directed to the Internet. A CSW policy can contain multiple match commands, each
with different selection criteria.
Syntax: default forward server-group-id
The default forward 2 command specifies what happens when the URL string does not meet any of
the selection criteria in a CSW policy’s match command. With a match command, you can specify a
server group ID number. In this example, if a URL string does not match the selection criteria in
policy p1, it is sent to Server Group 2 for evaluation.










