1
<?xml version="1.0" encoding="utf-8"?>
2
<html xmlns="http://www.w3.org/1999/xhtml">
4
<title>Change log for Varnish 1.1</title>
5
<link rel="stylesheet" type="text/css" href="changes.css"/>
8
<h1>Change log for Varnish 1.1</h1>
9
<h2>Changes between 1.0.4 and 1.1</h2>
13
<p>Readability of the C source code generated from VCL code
14
has been improved.</p>
17
<p>Equality (<span class="code">==</span>) and inequality
18
(<span class="code">!=</span>) operators have been implemented for IP
19
addresses (which previously could only be compared using
23
<p>The address of the listening socket on which the client
24
connection was received is now available to VCL as the
25
<span class="code">server.ip</span> variable.</p>
28
<p>Each object's hash key is now computed based on a string
29
which is available to VCL as <span class="code">req.hash</span>. A VCL hook
30
named <span class="code">vcl_hash</span> has been added to allow VCL scripts
31
to control hash generation (for instance, whether or not to
32
include the value of the <span class="code">Host:</span> header in the
36
<p>The setup code for listening sockets has been modified to
37
detect and handle situations where a host name resolves to
38
multiple IP addresses. It will now attempt to bind to each IP
39
address separately, and report a failure only if none of them
43
<p>Network or protocol errors that occur while retrieving an
44
object from a backend server now result in a synthetic error
45
page being inserted into the cache with a 30-second TTL. This
46
should help avoid driving an overburdened backend server into
47
the ground by repeatedly requesting the same object.</p>
50
<p>The child process will now drop root privileges
51
immediately upon startup. The user and group to use are
52
specified with the <span class="code">user</span> and <span class="code">group</span>
53
run-time parameters, which default to <span class="code">nobody</span> and
54
<span class="code">nogroup</span>, respectively. Other changes have been
55
made in an effort to increase the isolation between parent and
56
child, and reduce the impact of a compromise of the child
60
<p>Objects which are received from the backend with a
61
<span class="code">Vary:</span> header are now stored separately according to
62
the values of the headers specified in <span class="code">Vary:</span>. This
63
allows Varnish to correctly cache e.g. compressed and
64
uncompressed versions of the same object.</p>
67
<p>Each Varnish instance now has a name, which by default is
68
the host name of the machine it runs on, but can be any string
69
that would be valid as a relative or absolute directory name.
70
It is used to construct the name of a directory in which the
71
server state as well as all temporary files are stored. This
72
makes it possible to run multiple Varnish instances on the same
73
machine without conflict.</p>
76
<p>When invoked with the <span class="code">-C</span> option,
77
<span class="code">varnishd</span> will now not just translate the VCL code
78
to C, but also compile the C code and attempt to load the
79
resulting shared object.</p>
82
<p>Attempts by VCL code to reference a variable outside its
83
scope or to assign a value to a read-only variable will now
84
result in compile-time rather than run-time errors.</p>
87
<p>The new command-line option <span class="code">-F</span> will make
88
<span class="code">varnishd</span> run in the foreground, without enabling
92
<p>New VCL variables have been introduced to allow inspection
93
and manipulation of the request sent to the backend
94
(<span class="code">bereq.request</span>, <span class="code">bereq.url</span>,
95
<span class="code">bereq.proto</span> and <span class="code">bereq.http</span>) and the
96
response to the client (<span class="code">resp.proto</span>,
97
<span class="code">resp.status</span>, <span class="code">resp.response</span> and
98
<span class="code">resp.http</span>).</p>
101
<p>Statistics from the storage code (including the amount of
102
data and free space in the cache) are now available to
103
<span class="code">varnishstat</span> and other statistics-gathering
107
<p>Objects are now kept on an LRU list which is kept loosely
108
up-to-date (to within a few seconds). When cache runs out, the
109
objects at the tail end of the LRU list are discarded one by one
110
until there is enough space for the freshly requested object(s).
111
A VCL hook, <span class="code">vcl_discard</span>, is allowed to inspect each
112
object and determine its fate by returning either
113
<span class="code">keep</span> or <span class="code">discard</span>.</p>
116
<p>A new VCL hook, <span class="code">vcl_deliver</span>, provides a
117
chance to adjust the response before it is sent to the
121
<p>A new management command, <span class="code">vcl.show</span>, displays
122
the VCL source code of any loaded configuration.</p>
125
<p>A new VCL variable, <span class="code">now</span>, provides VCL scripts
126
with the current time in seconds since the epoch.</p>
129
<p>A new VCL variable, <span class="code">obj.lastuse</span>, reflects the
130
time in seconds since the object in question was last
134
<p>VCL scripts can now add an HTTP header (or modify the
135
value of an existing one) by assigning a value to the
136
corresponding variable, and strip an HTTP header by using the
137
<span class="code">remove</span> keyword.</p>
140
<p>VCL scripts can now modify the HTTP status code of cached
141
objects (<span class="code">obj.status</span>) and responses
142
(<span class="code">resp.status</span>)</p>
145
<p>Numeric and other non-textual variables in VCL can now be
146
assigned to textual variables; they will be converted as
150
<p>VCL scripts can now apply regular expression substitutions
151
to textual variables using the <span class="code">regsub</span>
155
<p>A new management command, <span class="code">status</span>, returns the
156
state of the child.</p>
159
<p>Varnish will now build and run on Mac OS X.</p>
165
<p>This is a new utility which sends a single command to a
166
Varnish server's management port and prints the result to
167
<span class="code">stdout</span>, greatly simplifying the use of the
168
management port from scripts.</p>
174
<p>The user interface has been greatly improved; the
175
histogram will be automatically rescaled and redrawn when the
176
window size changes, and it is updated regularly rather than at
177
a rate dependent on the amount of log data gathered. In
178
addition, the name of the Varnish instance being watched is
179
displayed in the upper right corner.</p>
185
<p>In addition to client traffic, <span class="code">varnishncsa</span>
186
can now also process log data from backend traffic.</p>
189
<p>A bug that would cause <span class="code">varnishncsa</span> to
190
segfault when it encountered an empty HTTP header in the log
191
file has been fixed.</p>
194
<h3>varnishreplay</h3>
197
<p>This new utility will attempt to recreate the HTTP traffic
198
which resulted in the raw Varnish log data which it is
205
<p>Don't print lifetime averages when it doesn't make any
206
sense—for instance, there is no point in dividing the
207
amount in bytes of free cache space by the lifetime in seconds
208
of the <span class="code">varnishd</span> process.</p>
211
<p>The user interface has been greatly improved;
212
<span class="code">varnishstat</span> will no longer print more than fits in
213
the terminal, and will respond correctly to window resize
214
events. The output produced in one-shot mode has been modified
215
to include symbolic names for each entry. In addition, the name
216
of the Varnish instance being watched is displayed in the upper
217
right corner in curses mode.</p>
223
<p>The user interface has been greatly improved;
224
<span class="code">varnishtop</span> will now respond correctly to window
225
resize events, and one-shot mode (<span class="code">-1</span>) actually
226
works. In addition, the name of the Varnish instance being
227
watched is displayed in the upper right corner in curses