Forum Discussion
David_Farkas_29
Nimbostratus
Feb 01, 2005Cache persistence on domain name
Under 4.x I've used a very simple cache rule to send requests to a set of caches. However, back in 4.2 PTF6, a 'special' feature was added to allow persistence to a cache based on the level of the ho...
unRuleY_95363
Feb 09, 2005Historic F5 Account
The following is an approximation of the logic used by the cache rule command. However, it does not remap uri's to a new cache member when a cache member goes down. In this rule, that is instead handled at the time a request for the uri comes in. I don't foresee this really being an issue though.
Here's the rule:
when HTTP_REQUEST {
if { } {
pool cache_pool
set key [crc32 [concat [domain [HTTP::host] 2] [HTTP::uri]]]
set cache_mbr [persist lookup hash $key node]
if { $cache_mbr ne "" } {
Make sure request isn't coming from the cache
if { [IP::addr [IP::remote_addr] equals $cache_mbr] } {
Yup, send the request from the cache to the origin pool
pool origin_pool
return
}
}
Make sure persistence record is added for this host/uri
persist hash $key
} else {
pool origin_pool
}
}
Substitute with whatever expression you would use to determine whether or not you want to send requests to the cache pool.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects