Deon
Jun 30, 2008Nimbostratus
When to iRule and when not to?
The task at hand today is a very simple redirect to an app login page when a user types only the host name and the uri is "/". The following code works. This is obviously super simple.
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "http://[HTTP::host]/MyApp/en/US/MyApp/Login.jsp"
}
}
There are no other iRules for this virtual server.
I see two ways to implement the redirect and am looking for feedback on which way is the the best route given that there are no other iRules for this VS.
1) Use above iRule. Looks at each and every request and redirects if uri is "/".
2) Create & package a simple rootredirect.war file with one (default) html page that does the redirect. Deploy this simple war on tomcat server.
Implementing the redirect with an iRule obviously creates overhead on the BigIP as each and every HTTP_REQUEST fires the (albeit small & simple) iRule to execute. The rootredirect.war approach does not incur such overhead but does create one addl war that needs to be deployed on the tomcat server.
So, given there are no other requirements that would require to look at each HTTP_REQUEST, would it be more desirable to implement the redirect at the tomcat server and save the processing cycles on the BigIP?
Am I splitting hairs and worrying about something I should not necessarily worry about?
Looking for the opinion of others here.
Thanks
-Deon