Cache support for database protocols

The integrated cache feature monitors and caches database request as determined by the cache policies. Users must configure the cache policies for MYSQL and MSSQL protocols as the Citrix ADC appliance does not provide any default policies. When configuring the default protocols, remember the request-based policies support only CACHE and INVAL actions, while response-based policies support only “NOCACHE” action. After configuring the policies, you must bind them to virtual servers. MYSQL and MSSQL policies, both request and response, are bound only to virtual servers.

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

The following example explains how to configure and verify 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