I have a project where I would like to use BigIP to redirect 200+ domains to different domains. Sometimes to a host::uri.
How many “If Else” can one have in an iRule? Would a better approach be to have separate iRules for each redirection?
I am very interested in using a best practice approach for this device and definitely don’t want to put any major stress to a bustling production system.
You could chain 200 if/elseif…/else together, but it would get a bit unwieldy. You could still use a datagroup in 9.3.1. But you’d use matchclass or findclass to search the class. ~200 lines shouldn’t add a lot of overhead but it’s always good to do performance testing if you can before using a rule like this in production. If the redirects are all of the same VIP, it would be best to combine the redirects in a single iRule. This helps you avoid attempting to send multiple redirects on the same request (which triggers a runtime TCL error).