Can you post some anonymized samples of the URI's you want to rewrite? Is the client using an absolute URI? Something like this?
GET http://www.w3.org:55555/pub/WWW/TheProject.html HTTP/1.1
User-Agent: ...
If so, you could use string map instead of regsub. The string function would be more efficient than a regex.
HTTP::uri [string map {:55555/ /} [HTTP::uri]]
If you also need to rewrite the port in response content, you could use a stream filter and STREAM::expression based iRule. This would be more efficient than collecting the response content and performing regex operations on it. You can check the STREAM::expression wiki page (
Click here) for examples.
Aaron