I do two things for my custom maintenance pages. I use a CDN or image host (see Amazon S3, CloudFlare, Akamai, Imgur, etc) to host all images on the page (for big sites I recommend a CDN, CloudFlare has a free plan). Then I move the HTML for the page into an external file and use std.fileread
which is built into Varnish. E.g:
import std;
sub deliver_maintainance_page
{
set obj.http.Content-Type = "text/html; charset=utf-8";
synthetic std.fileread("/var/www/errors/503.html");
return(deliver);
}
This cleans up your VCL file and reduces page weight (no more inline images).