Configure a cache redirection policy
-
CACHE
-
ORIGIN
Add a cache redirection policy by using the CLI
- add cr policy <policyName> **-rule** <expression> -action<string> [-logAction<string>]
- show cr policy [<policyName>]
> add cr policy crpol1 -rule !(HTTP.REQ.URL.ENDSWITH(".jpeg")) -action origin
Done
> show cr policy crpoll
Policy: crpol1 Rule: !(HTTP.REQ.URL.ENDSWITH(".jpeg")) Action: ORIGIN
Hits: 0
Done
> add cr policy crpol11 -rule 'http.req.method.eq(post) && (HTTP.REQ.URL.ENDSWITH(".gif") || HTTP.REQ.URL.ENDSWITH(".cgi"))' -action cache
Done
> show cr policy crpol11
Policy: crpol11 Rule: http.req.method.eq(post) && (HTTP.REQ.URL.ENDSWITH(".gif") || HTTP.REQ.URL.ENDSWITH(".cgi")) Action: CACHE
Hits: 0
Done
> add cr policy crpol12 -rule http.req.header("If-Modified-Since").exists -action origin
Done
> show cr policy crpol12
Policy: crpol12 Rule: http.req.header("If-Modified-Since").exists Action: ORIGIN
Hits: 0
Done
Modify or remove a cache redirection policy by using the CLI
-
To modify a cache redirection policy, use the set cr policy command, which is just like add cr policy command, except that you enter the name of an existing policy and you only have to provide the parameters that you want to modify.
-
To remove a policy, use the
rm cr policycommand, which accepts only the \<name\> argument. If the policy is bound to a virtual server, you have to unbind the policy, before you can remove it.
Configure a cache redirection policy with a simple expression by using the GUI
-
Navigate to Traffic Management > Cache Redirection > Policies.
-
In the details pane, click Add.
-
In the Create Cache Redirection Policy dialog box, in the Name text box, type the name of the policy.
-
Select the appropriate action CACHE or ORIGIN from the Action drop-down list.
-
In the Log Action area, click Add. Type a name in the Create Audit Message Action dialog box.
-
Configure Log Level by choosing the appropriate value from the drop-down list:
-
EMERGENCY
-
ALERT
-
CRITICAL
-
ERROR
-
WARNING
-
NOTICE
-
INFORMATIONAL
-
DEBUG
-
-
Enter the expression in the Expression area. Configure an advanced expression. For more information, see Policy Expressions.
-
Click Create.
-
-
Configure the rule using the advanced expression. For more information see Policy Expressions.
-
When you are finished entering the expression, click Create.