Forum Discussion
Leo
Nimbostratus
Jun 27, 2013Clearing machine cache
Hello all,
Today we are using a TMSH command to clear the machines cache by running:
delete ltm profile ramcache http-wan-optimized-compression-caching-cache
I want to be able t...
Leo
Nimbostratus
Jul 08, 2013Thanks for the responses!
I eventually used the user_alert.conf file, here's what I did:
iRule
Delete cache on request, based on source IP
iRule log triggers /config/user_alert.conf
to clear the cache!
when HTTP_REQUEST {
Check URI
if { [string tolower [HTTP::uri]] contains "delete-cache-now" } {
set ip1 a.a.a.a/32
set ip2 b.b.b.b/32
set ip3 c.c.c.c/32
Check Source IP
if { [IP::addr [IP::client_addr] equals $ip1] or [IP::addr [IP::client_addr] equals $ip2] or [IP::addr [IP::client_addr] equals $ip3] } {
HTTP::respond 200 content "Cache CleanHello [IP::client_addr]
Cache cleaned!"
log local0. "EVENT-CACHE-DELETE-REQUEST-GOOD!!! - IP [IP::client_addr]"
Stop processing iRules for this connection
event disable
return
}
}
}
/config/user_alert.conf
alert Delete-Cache-Request "EVENT-CACHE-DELETE-REQUEST-GOOD!!!" {
exec command="tmsh -c 'delete ltm profile ramcache http-wan-optimized-compression-caching-cache'"
}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