Forum Discussion
dan_6764
Nimbostratus
Jul 14, 2009Caching issue
Hi,
I am running version 10.0.0 on my LTM. I wish to be able to flush certain items from my cache dependant on file type/age etc..
I have written the rule below but it d...
dan_6764
Nimbostratus
Jul 14, 2009ok.. think i have cracked it... unless anyone can see something I am missing
hen RULE_INIT {
set ::10_secs 10
set ::20_secs 20
set ::one_day 86400
set ::two_hours 7200
set ::one_week 604800
}
when HTTP_REQUEST {
set requested_uri [HTTP::uri]
}
when HTTP_RESPONSE {
if { $requested_uri ends_with ".jpg" } {
} elseif { $requested_uri ends_with ".gif" } {
CACHE::enable
} else
{ CACHE::disable
}
}
when CACHE_REQUEST {
if { ([CACHE::age] > $::10_secs and $requested_uri ends_with ".jpg") or ([CACHE::age] > $::20_secs and $requested_uri ends_with ".gif") } {
CACHE::expire
log local0. "Expiring content: Age > x seconds & $requested_uri "
}
}
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