Forum Discussion
MikeStearns_600
Nimbostratus
Jan 29, 2009HELP with a new irule...disable acceleration
Hello. I am looking to create an irule to do the following:
If the request doesn't end with /abc123.html
AND
if the request doesn't begin with /CPOS2
AND
if the request doesn't begin with /NEXTAPP
THEN
disable acceleration
AND
disable LTM cache
This is what I have so far. I would appreciate any help. I am new to writing code.
when HTTP_REQUEST {
if { not ( [HTTP::uri] ends_with "/abc123.html" && not ( [HTTP::uri] begins_with "/CPOS2" && not ( [HTTP::uri] begins_with "/NEXTAPP") } {
HTTP::class disable
CACHE::disable
}
7 Replies
- Colin_Walker_12Historic F5 AccountWhen you say "disable acceleration" what exactly are you looking to do?
when HTTP_REQUEST { if { (not ( [HTTP::uri] ends_with "/abc123.html")) && ( not ( [HTTP::uri] begins_with "/CPOS2")) && (not ( [HTTP::uri] begins_with "/NEXTAPP")) } { HTTP::class disable CACHE::disable } }
- MikeStearns_600
Nimbostratus
We want to disable the IBR feature while adding new applications to the F5. I guess we prefer doing an iRule instead of a WA policy change. For example.....we would be able to setup the policy prior to production and the only change for us to do would be deleting the iRule for the new application to go productive. - MikeStearns_600
Nimbostratus
I seem to be getting the following error when trying to create the irule above. - JRahm
Admin
The operator should be starts_with instead of begins_with - hoolio
Cirrostratus
Also, I think 'HTTP::class disable' disables the class selection for the duration of the TCP connection. You may want to enable it if the checks aren't true. I think CACHE::disable isn't subject to this as the caching decision is done on each request/response. You could check this by making one matching request and one non-matching request over the same TCP connection and check the debug logging.when HTTP_REQUEST { Check if URI matches these checks switch -glob [HTTP::uri] { "*/abc123.html" - "/CPOS2*" - "/NEXTAPP*" { log local0. "[IP::client_addr]:[TCP::client_port]: Not disabling caching/enabling class selection for [HTTP::uri]" HTTP::class enable } default { log local0. "[IP::client_addr]:[TCP::client_port]: Disabling caching/class selection for [HTTP::uri]" HTTP::class disable CACHE::disable } } }
- MikeStearns_600
Nimbostratus
Thanks Aaron. If this does what i need, which section do I take out to stop the debug logging? I hope to test later this week. - hoolio
Cirrostratus
To disable the logging, you can comment out the log lines with a hash:
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