Load Balancing to Casches

i need to implement the below 2 functions with LTM to load balance to Cache servers :

Election Hashing , Top Domain Selection

will all of that be done using IRules ? will it be one Irule or three ? Can you help me with examples

are you using v10? if so, just wonder why you do not just use built-in carp.

sol11362: Overview of the CARP hash algorithm

Thanks , does this achive Top Domain selection ?

also it mentions the Irule :

when HTTP_REQUEST {

persist hash [HTTP::uri]

}

This persists based on the URI , my target is to persist based on the site ( all tarffic of youtube to go to same cache … ) , what is the IRule for that ?

you can use [HTTP::host] instead of [HTTP::uri].

Thanks alot , what about meaning / benefit of " Top Domain selection" ?

i guess you mean to load balance by using part of FQDN. if so, yes it is possible. you can specify any part of FQDN when doing CARP i.e. replace [HTTP::host] with whatever you want.