Forum Discussion
Do I risk problems with a lengthy URI redirect
I am wondering how long can an Irule be without running into problems. I have this rule below that can get two or three times this long. Is that ok? Is it written ok? thanks
when HTTP_REQUEST { switch -gob [string tolower [HTTP::uri]] { "/static" { pool MTCPHONE_POOL } "/phone" { pool MTCPHONE_POOL } "/travel" { pool CDN_POOL } "/mediaportal" { pool CDN_POOL } "/sle" { pool CDN_POOL } "/tcvt" { pool CDN_POOL } "/plan-study-teach" { pool CDN_POOL } "/volunteermanager" { pool CDN_POOL } "/readingtutors" { pool CDN_POOL } "/languagebasics" { pool CDN_POOL } "/premtclanguage" { pool CDN_POOL } "/trcmanager" { pool CDN_POOL } "/missionaryinternetuse" { pool CDN_POOL } "/mtcmanager" { pool CDN_POOL } "/imtchome" { pool CDN_POOL } "/ecclesiasticalmanager" { pool CDN_POOL } "/missions" { pool CDN_POOL } "/onlinetutoring" { pool CDN_POOL } "/referralmanager" { pool CDN_POOL } "/devicetracker" { pool CDN_POOL } "/sre" { pool CDN_POOL } "/operations" { pool CDN_POOL } "/confluence" { pool CONFLUENCE_POOL } "/svn/internal" { pool SUBVERSION_POOL } "/svn/internal/!svn/" { pool SUBVERSION_POOL } "/mymissionlocale" { pool MYMISSIONLANGUAGE_POOL } } }
The irule should work just fine without any issue in an average site, but I am not sure about the performance impact in very heavy traffic environments.
Anyway, I wouldn't use such a code with a switch testing, I would rather use datagroups to define my uri:pool pairs. This will lead to a very small irule, an easy to manage and maintain mappings (from the GUI), and an important performance gain.
- MikeBrockbank_3
Nimbostratus
What do you mean by "switch testing". The code does use the "switch" command. thanks!
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