-
Notifications
You must be signed in to change notification settings - Fork 378
VIP14: *.body access
Poul-Henning Kamp edited this page Feb 27, 2017
·
2 revisions
Plan for VCL access/manipulation of *.body and VMOD filter insertion
So for instance synthetic objects can be gzip'ed or ESI'ed, but without overworking the workspaces.
The list of filters to be applied is turned into a list of filter names, something like:
req.filters = "gunzip esi gzip"
VCL can edit this list, for instance with regsub() to insert VMOD filters
A special class of VCL functions can stuff things into the filter pipelines:
sub vcl_foobar {
body += "<HTML>"
body += "<H1>" + req.http.foobar + "</H1>"
...
}
The vcl_error{} and vcl_synthetic{} functions set up the HTTP headers, configure the filter list and designate the function to fill out the body:
sub vcl_synthetic {
...
return (deliver(vcl_foobar));
}