Forum Discussion
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 forum and have seen you can utilize the http profile along with an irule. But then also see that just using the ram cache is enough.
I would think it would be simple to list the standard images, ie .jpeg, .jpg, png etc.
Has anyone done any testing with a http profile and verified it is working and what were the results.
Sort of looking for an example and wondering what most people do.
Thanks for any info.
13 Replies
- Phil_53695
Nimbostratus
Hi, - Phil_53695
Nimbostratus
- extra switch pattern with no body - Phil_53695
Nimbostratus
- extra switch pattern with no body - Peter_72728
Nimbostratus
It could be caused by the "else" case. I think you want to use "default" there. - Phil_53695
Nimbostratus
extra switch pattern with no body while executing "switch -glob? - Kevin_Davies_40
Nacreous
Peter,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]" } } } }
Tip - When pasting iRules put inside "code" blocks then submit, edit, submit to get the code looking like above.
- Phil_53695
Nimbostratus
Thanks for adding the info.I really appreciate it.I'm going to test it out this morning and then read up on how to gather some stats because I think that'll be the next thing they want to see. - Phil_53695
Nimbostratus
Hi All, - Peter_72728
Nimbostratus
Are you trying to do this check based on the request URI? I see HTTP::uri in your switch, but some of the values in the switch cases don't look like valid URI patterns.when HTTP_REQUEST { set debug 1 switch -glob [string tolower [HTTP::uri]] { "text/*javascript" - this looks like a content type. Do you really have a URI pattern in the site that looks like this? "*/scripts/*.js" - needs to have a leading wildcard "text/*.css" - is this a content type, too? Or should it have a leading wildcard? "*/images/*.swf" - needs to have a leading wildcard -- and the "s" in "images" "*/images/*.gif" - "*/images/*.png" - "*/images/*.jpg" - "*/images/*.jpeg" ...
- Phil_53695
Nimbostratus
Thanks for taking the time to repond. I understand it much better now and will adjust it accordingly and let the group know the out come.
Recent Discussions
Related Content
* 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