There are extensive changes under the hood with respect to statistics counters, but these should all be transparent at the user-level.
The vsm_space and cli_buffer parameters are now deprecated and ignored. They will be removed in a future major release.
The updated shared memory implementation manages space automatically, so it no longer needs vsm_space. Memory for the CLI command buffer is now dynamically allocated.
We have updated the documentation for send_timeout, idle_send_timeout, timeout_idle and ban_cutoff.
Added the debug bit vmod_so_keep, see debug and the notes about changes for developers below.
We have added a few new variables and clarified some matters. VCL written for Varnish 5.1 should run without changes on 5.2.
VCL symbols originate from various parts of Varnish: there are built-in variables, subroutines, functions, and the free-form headers. Symbols may live in a namespace denoted by the '.' (dot) character as in req.http.Cache-Control. When you create a VCL label, a new symbol becomes available, named after the label. Storage backends always have a name, even if you don't specify one, and they can also be accessed in VCL: for example storage.Transient.
Because headers and VCL names could contain dashes, while subroutines or VMOD objects couldn't, this created an inconsistency. All symbols follow the same rules now and must follow the same (case-insensitive) pattern: [a-z][a-z0-9_-]*.
You can now write code like:
sub my-sub {
new my-obj = my_vmod.my_constuctor(storage.my-store);
}
sub vcl_init {
call my-sub;
}
As you may notice in the example above, it is not possible yet to have dashes in a vmod symbol.
Long storage backend names used to be truncated due to a limitation in the VSC subsystem, this is no longer the case.
Added req.hash and bereq.hash, which contain the hash value computed by Varnish for cache lookup in the current transaction, to be used in client or backend context, respectively. Their data type is BLOB, and they contain the raw binary hash.
You can use vmod_blob to work with the hashes:
import blob;
sub vcl_backend_fetch {
# Send the transaction hash to the backend as a hex string
set bereq.http.Hash = blob.encode(HEX, blob=bereq.hash);
}
sub vcl_deliver {
# Send the hash in a response header as a base64 string
set resp.http.Hash = blob.encode(BASE64, blob=req.hash);
}
If the -i option is not set in the invocation of varnishd, then server.identity is set to the host name (as returned by gethostname(3)). Previously, server.identity defaulted to the value of the -n option (or the default instance name if -n was not set). See varnishd.
Added bereq.is_bgfetch, which is readable in backend contexts, and is true if the fetch takes place in the background. That is, it is true if Varnish found a response in the cache whose TTL was expired, but was still in grace time. Varnish returns the stale cached response to the client, and initiates the background fetch to refresh the cache object.
We have clarified what happens to req.backend_hint on a client restart -- it gets reset to the default backend. So you might want to make sure that the backend hint gets set the way you want in that situation.
See vmod_blob, vmod_purge and vmod_vtc. Read about them in New VMODs in the standard distribution.
We have clarified the interpretation of a ban when a comparison in the ban expression is attempted against an unset field, see ban(STRING) in VCL.
varnishd(1):
varnishstat(1):
varnishlog(1):
The Hit, HitMiss and HitPass log records grew an additional field with the remaining TTL of the object at the time of the lookup. While this should greatly help troubleshooting, it might break tools relying on those records to get the VXID of the object hit during lookup.
Instead of using Hit, such tools should now use Hit[1], and the same applies to HitMiss and HitPass.
The Hit record also grew two more fields for the grace and keep periods. This should again be useful for troubleshooting.
See VSL.
The SessOpen log record displays the name of the listen address instead of the endpoint in its 3rd field.
See VSL.
The output format of VCL_trace log records, which appear if you have switched on the VCL_trace flag in the VSL mask, has changed to include the VCL configuration name. See VSL and vsl_mask.
varnishtest(1) and vtc(7):
varnishncsa(1)
The -N command-line option, which was previously available for varnishlog(1), varnishstat(1), varnishncsa(1) and varnishhist(1), is not compatible with the changed internal logging API, and has been retired.
Changes for developers:
eof