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...
Phil_53695
Aug 11, 2011Nimbostratus
Hi All,
I have tried to test this irule but nothing of the items that are listed seem to be getting caches as shown below at
the ltm log
I do have an http profile setup for ram cache turned on.
ltm log:
"Non Caching /app_themes/default/images/icon.check.png"
Based on my irule, shouldn't the *.png be cached?
Below is the script and I suppose I am off somewhat. All I am trying to do is setup a simple RAM cache, add this irule in to see if it's working and then turn off debug. The customers will probably want to see some stats but first I need to ensure it works.
Any one know why?
when HTTP_REQUEST {
set debug 1
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]" }
{
HTTP::header replace "Cache-Control" "private, max-age=86400" }
}
}
}
when CACHE_REQUEST { log local0. "[CACHE::hits] cache hits for document at [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