Cache support for database protocols

The integrated cache monitors database requests that flow through the Citrix® ADC appliance and caches them as determined by the cache policies. Users have to configure the cache polices for MYSQL and MSSQL protocols, because the appliance does not provide any default policies for these protocols. When configuring the protocols, remember that request based policies currently support CACHE and INVAL actions, while response based policies currently support only NOCACHE action. After configuring the policies, bind them to virtual servers. MYSQL and MSSQL policies, both request and response, can be bound only to virtual servers

Before creating a cache policy, create a cache content group of type MYSQL or MSSQL. When you create a MYSQL or MSSQL cache content group, associate at least one hit selector with it. See Setting Up a Basic Content Group for setting up cache content groups.

The following example illustrates the procedure for configuring and verifying cache support for SQL protocols.

> enable feature IC
> set cache parameter -memlimit 100
> add cache selector sel1 mssql.req.query.text

> add cache contentgroup cg1  -type "MSSQL" -hitselector "sel1" -invalselector "inval_sel" -relExpiry "500" -maxResSize
> add cache policy cp1  -rule "mssql.req.query.command.contains(\"select\")" -action "CACHE" -storeInGroup "cg1"
> add cache policy cp2  -invalObjects "cg1" -rule "mssql.req.query.text.contains(\"insert\")" -action "INVAL"
> add db user user1  -password "Pass1"
> add service svc_sql_1 mssql 64834 -healthMonitor "NO" -downstateflush "ENABLED"
> add lb vserver lb_mssql1 mssql 1433  -lbmethod "roundrobin"
> bind lb vserver lb_mssql1 svc_sql_1
> bind lb vserver lb_mssql1 -policyName cp1  -type "REQUEST" -priority "2"
> bind lb vserver lb_mssql1 -policyName cp2  -type "REQUEST" -priority "1"

> show cache selector sel1
> show cache policy cp1
                    Stored in group: cg1
                    UndefAction:Use Global
                    Undef Hits:0
                    Policy is bound to following entities
                    1) Bound to:
                                REQ VSERVER lb_mssql1
                                GotoPriorityExpression: END


The methods for reducing flash crowds, as explained in Reducing Flash Crowds, are not supported for MYSQL and MSSQL protocols.

Cache support for database protocols