Update zipflow
Update to Varnish-Cache 7.5
Implement set_level
This module provides a Varnish-Cache Delivery Processor (VDP) interface to Mark Adler's zipflow library to package and compress responses into the ZIP format.
The primary repository is at https://code.uplex.de/uplex-varnish/libvmod-zipflow
This server does not accept user registrations, so please ...
use the sourcehut bug tracker to report issues.
You may also use the sourcehut git repository.
Using this VMOD, ZIP responses can be generated on the fly from an arbitrary number of objects. The mechanism is similar to ESI handling in Varnish-Cache: For each object to be added as a file in the ZIP archive, a sub-request is generated.
The resulting ZIP is generated while it is being delived. It is not stored (this can, however, be achieved with requests from varnish to itself).
Example: Send the response body as a zip file containing "filename":
import zipflow;
sub vcl_init {
zipflow.set_level(9);
}
sub vcl_deliver {
zipflow.meta("filename");
set resp.filters += " zipflow";
}
Example: Create a two subrequests for other URLs, which are bundled into the ZIP response:
import zipflow;
sub vcl_recv {
if (req.url == "/zip") {
return (synth(1200));
}
}
sub synth_zipflow {
if (zipflow.is_subreq()) {
return;
}
# activate zipflow
set resp.filters = "zipflow";
set resp.body = " "; // REQUIRED!
# do not put this body into the zip
zipflow.bundle(false);
# create two subrequests to put into the zip
zipflow.subreq("/file1");
zipflow.subreq("/file2");
return (deliver);
}
sub vcl_synth {
if (resp.status == 1200) {
call synth_zipflow;
}
}
This README is only intended as a first introduction, for more details, please refer to the vmod_zipflow(3) man page. If you are reading this file on line, it should also be available as vmod_zipflow.man.md.
See INSTALL.md.
To report bugs, please use the sourcehut bug tracker.
For enquiries about professional service and support, please contact info@uplex.de.
To contribute to the project, please use the sourcehut bug tracker.
To support the project's development and maintenance, there are several options:
This project was greatly facilitated by Mark Adler's zipflow library.
Copyright 2022, 2023 UPLEX Nils Goroll Systemoptimierung
All rights reserved
Author: Nils Goroll <nils.goroll@uplex.de>
See LICENSE