Forum Discussion
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
James
- nitassEmployeeare these useful?
- jamesthethird_4NimbostratusSideband connection is cool! However the example shows the connection is opened upon an HTTP_REQUEST event.
- nitassEmployeeThe second link shows how to add a JS code on the fly, which is OK. The question was how to update the JS you are about to add. previously i thought you might retrieve dynamic content upon request, store it in variable and then insert it on the fly.
- jamesthethird_4NimbostratusStoring the content in a file might be a good idea for replacing the variable. However, we would like to focus on issuing a sideband connection every 5 minutes and updating the file/variable, regardless of traffic in the main channel. Is there such a mechanism (like a timer) for issuing a sideband connection every predefined period of time?
- Wand_97484NimbostratusHi James,
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