Forum Discussion
Phil_53695
Aug 10, 2011Nimbostratus
What is most efficient way to setup http profile with ram cache
Having not used the ram cache feature at my previous position. I want to setup a simple ram cache to take some of the load off the web serve for images and some static items. I've search around the f...
Kevin_Davies_40
Aug 11, 2011Nacreous
Peter,
- Switch does not support an else statement.
-The S in "Scripts/*.js" should be s or it will never match.
- logging all traffic generates quite a lot of data - added debug flag. Set to 1 for testing, 0 for production.
The code should look like....
when HTTP_REQUEST {
set debug 0
switch -glob [string tolower [HTTP::uri]] {
"text/*javascript" -
"scripts/*.js" -
"text/*.css" -
"image/*.swf" -
"image/*.gif" -
"image/*.png" -
"image/*.jpg" -
"image/*.jpeg" {
CACHE::enable
if {$debug} { log local0. "Caching [HTTP::uri]" }
}
default {
CACHE::disable
if {$debug} { log local0. "Non Caching [HTTP::uri]" }
}
}
}
Jarvil
Tip - When pasting iRules put inside "code" blocks then submit, edit, submit to get the code looking like above.
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