Adding dynamic content to a request
I've recently got a task from my boss to build an advanced iRule to one of our F5, and i'm struggling to understand if this is even doable with iRules.
To make a long story short, this is the high level design:
The F5 is in-line with all traffic coming in and out our website. Now, we want to add a small code to some of the outgoing responses (according to their path in the URL), in a fixed location. Here comes the tricky part:
This added code piece is dynamic, and should be queried from a third party server located at one of our partners data center. The code changes from time to time (more or less on a daily basis), and whenever it changes the new piece of code should be embedded in the same location. Now, our server handles a lot of traffic (hundreds of HTTPS requests per second on peak), and I find it very ineffiencent to query the dynamic code for every response served by our website.
So - my plan is to query the third party server every few minutes (separately from the ongoing website traffic), store the new code in a variable and add the most up-to-date code to the response.
So, is this achievable by an iRule?
Will appreciate your assistance with this challenge...
Thanks in advance