Forum Discussion
Phil_53695
Aug 18, 2011Nimbostratus
Cache hits show 0 on irule when looking at ltm log
Hi,
Below is an irule that I am trying to debug to see if indeed the URI(s) file types get cached and nothing else.
From viewing the ltm log, I see:
: 0 cache hits /Public/Legal/img/foot_back_bot.png
So I assume my syntax must be off since it "should" be caching the .png as per my irule.
when HTTP_REQUEST {
set debug 1
set foundmatch 0
if { ([HTTP::uri] contains ".swf") or ([HTTP::uri] contains ".js") or ([HTTP::uri] contains ".css") or ([HTTP::uri] contains ".png") or ([HTTP::uri] contains ".jpeg") or ([HTTP::uri] contains ".jspg") or ([HTTP::uri] contains ".gif")} {
if {$foundmatch} { log local0. "Caching [HTTP::uri]" }
CACHE::enable }
else {CACHE::disable }
}
when CACHE_REQUEST { log local0. "[CACHE::hits] cache hits [HTTP::uri]" }
Thanks for any input
2 Replies
Sort By
- when HTTP_REQUEST {
- Hi Phil,
when HTTP_REQUEST { switch -glob [HTTP::path] { ".swf" - ".js" - ".css" - ".png" - ".jpeg" - ".pspg" - ".gif" { CACHE::enable log local0. "Caching [HTTP::uri]" } default { CACHE::disable } } } when CACHE_REQUEST { log local0. "[CACHE::hits] cache hits [HTTP::uri]" }
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