A customer is requesting that a maintenance page be displayed for their VIP when their pool members are down. They have provided the HTML code with some Base64 embedded images.
I’m just wondering what the most effective/efficient/easiest way to implement this is? I tried searching, but I came across some overly complicated irules that I don’t believe I need.
Except that you don’t really need to keep the images in base64 anymore. You can upload the raw images into iFiles and call them directly. You can also store the base64-encoded images in an internal or external data group and use the ‘class’ command to fetch them. The below is a modified example using iFiles.
So basically, your HTML document is going to include image directives (src tags), which should include relative URLs (ex. “./logo.png”). When all pool members are down, the first action will be to send the HTML page (the else condition). The browser will then make separate requests for the embedded src tag images, which the above iRule will respond with.
You could also technically embed the images directly into the HTML document using “data:image/png;base64” syntax. See https://varvy.com/pagespeed/base64-images.html for a good reference. In that case you’d just need a single, albeit large, HTML file to send.