Product Documentation

Policy Configuration Examples

Feb 13, 2017

These examples show how policies and their associated actions are entered at the command line interface. In the configuration utility, the expressions would appear in the Expression window of the feature-configuration dialog box for the integrated caching or rewrite feature.

Following is an example of creating a caching policy. Note that actions for caching policies are built in, so you do not need to configure them separately from the policy.

 add cache policy BranchReportsCachePolicy -rule q{http.req.url.query.value("actionoverride").contains("branchReports")} -action cache  

Following is an example of a Rewrite policy and action:

 add rewrite action myAction1 INSERT_HTTP_HEADER "myHeader" "valueForMyHeader" 
 add rewrite policy myPolicy1 "http.req.url.contains(\"myURLstring\")" myAction1 
Note: At the command line, quote marks within a policy rule (the expression) must be escaped or delimited with the q delimiter. For more information, see "Configuring Default Syntax Expressions in a Policy."