#- # Copyright 2022 UPLEX Nils Goroll Systemoptimierung # All rights reserved # # Author: Nils Goroll # # See LICENSE # $Module zipflow 3 "Varnish zipflow Module" NOTE ==== This vmod needs https://github.com/varnishcache/varnish-cache/pull/3843 DESCRIPTION =========== .. _zipflow: https://github.com/madler/zipflow This module provides a Varnish Delivery Processor (VDP) interface to Mark Adler's `zipflow`_ library to package and compress responses into the ZIP format. Example :: import zipflow; sub vcl_init { zipflow.set_level(9); } sub vcl_deliver { zipflow.meta("filename"); set resp.filters += " zipflow"; } $Function VOID set_level(INT level) Set the (default) compression level for the zipflow filter. Valid values for `level` are -1 to select the default compression level ``Z_DEFAULT_COMPRESSION``, which is also the overall default, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). ``Z_DEFAULT_COMPRESSION`` requests a default compromise between speed and compression (currently equivalent to level 6). [Text copied from zlib.h] When used from ``vcl_init {}``, sets the default for all tasks from all VCLs. Any such call affects all VCLs using this vmod, setting the default per VCL is not currently supported. When used elsewhere, sets the level for the current task. Calls from ``esi_level`` > 0 have no effect. $Function VOID meta(STRING name, STRING mode="0644", TIME atime=0, TIME mtime=0) Set zip metadata for the currently streamed object: * `name`: Filename * `mode`: UNIX mode bits, default to 0644 Note: This argument is of string type and interpreted as *octal*. * `atime`: Access time, defaults to ``now``. * `mtime`: Modification time, defaults to ``now``. SEE ALSO ======== vcl\(7), varnishd\(1) $Event event