Forum Discussion
pwallace_110041
Nimbostratus
Jul 31, 2006Optimization review
I am looking for any way to make this little rule better, cleaner, optimized etc. iRules are my first foray into coding and I am looking for tips and tricks.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/locmap/" and [HTTP::uri] contains ".asp" ||
[HTTP::uri] starts_with "/locmap/" and [HTTP::uri] ends_with ".css" ||
[HTTP::uri] starts_with "/scripts/webgate.dll/" ||
[HTTP::uri] starts_with "/locmap/" and [HTTP::uri] ends_with ".gif" } {
pool mappool
} else {
discard
}
}
Regards,
Pippin
- You have a fairly straight-forward rule but I see a couple of things right off
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/locmap/" } { if { ([HTTP::uri] contains ".asp") || ([HTTP::uri] ends_with ".css") || ([HTTP::uri] ends_with ".gif") } { pool mappool } else { discard } } elseif { [HTTP::uri] starts_with "/scripts/webgate.dll/" } { pool mappool } else { discard } }
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