A Varnish Delivery Processor (VDP) interface to Mark Adler's zipflow library to package and compress responses into the ZIP format.
Find a file
Nils Goroll 593ddb734e
Add submodule sync to make update target
... because it seems I can not remember how git submodule works
2025-04-03 09:21:56 +02:00
src Adjust to VDP API Changes from VC#4035 2025-04-03 08:59:46 +02:00
.gitignore subreqs_from_body - simplified and memory-saving request creation 2023-09-08 22:15:16 +02:00
.gitmodules Fix zipflow branch to match the checked out commit 2025-04-03 09:21:56 +02:00
bootstrap vcdk template 2022-09-06 12:56:25 +02:00
configure.ac Update to Varnish-Cache 7.5 2024-10-20 13:09:58 +02:00
INSTALL.md Add markdown for sr.ht and improve documentation 2023-09-10 21:02:44 +02:00
INSTALL.rst Add markdown for sr.ht and improve documentation 2023-09-10 21:02:44 +02:00
LICENSE Add markdown for sr.ht and improve documentation 2023-09-10 21:02:44 +02:00
Makefile.am Add submodule sync to make update target 2025-04-03 09:21:56 +02:00
README.md Does this look better 2023-09-10 21:09:48 +02:00
README.rst Does this look better 2023-09-10 21:09:48 +02:00

title
vmod zipflow: On-the-fly ZIP bundling for Varnish Cache

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.

PROJECT RESOURCES

You may also use the sourcehut git repository.

INTRODUCTION

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).

Examples

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.

INSTALLATION

See INSTALL.md.

SUPPORT

To report bugs, please use the sourcehut bug tracker.

For enquiries about professional service and support, please contact info@uplex.de.

CONTRIBUTING

To contribute to the project, please use the sourcehut bug tracker.

To support the project's development and maintenance, there are several options:

  • Donate money through paypal. If you wish to receive a commercial invoice, please add your details (address, email, any requirements on the invoice text) to the message sent with your donation.
  • Become a github sponsor.
  • Contact info@uplex.de to receive a commercial invoice for SWIFT payment.

ACKNOWLEDGEMENTS

This project was greatly facilitated by Mark Adler's zipflow library.

COPYRIGHT

Copyright 2022, 2023 UPLEX Nils Goroll Systemoptimierung
All rights reserved

Author: Nils Goroll <nils.goroll@uplex.de>

See LICENSE