<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>The Varnish Users Guide on Varnish Cache</title><link>https://www.varnish.org/docs/users-guide/</link><description>Recent content in The Varnish Users Guide on Varnish Cache</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 16 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.varnish.org/docs/users-guide/index.xml" rel="self" type="application/rss+xml"/><item><title>Achieving a high hitrate</title><link>https://www.varnish.org/docs/users-guide/increasing-your-hitrate/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/increasing-your-hitrate/</guid><description>&lt;!-- Copyright (c) 2012-2020 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-increasing-your-hitrate"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now that Varnish is up and running you can access your web application
through Varnish. Unless your application is specifically written to
work behind a web accelerator you’ll probably need to do some
changes to either the configuration or the application in order to
get a high hitrate in Varnish.&lt;/p&gt;
&lt;p&gt;Varnish will not cache your data unless it’s absolutely sure it is
safe to do so. So, for you to understand how Varnish decides if and
how to cache a page, we’ll guide you through a couple of tools that
you should find useful to understand what is happening in your
Varnish setup.&lt;/p&gt;</description></item><item><title>ACLs</title><link>https://www.varnish.org/docs/users-guide/vcl-example-acls/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-example-acls/</guid><description>&lt;!-- Copyright (c) 2013-2015 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;You create a named access control list with the &lt;code&gt;acl&lt;/code&gt; keyword. You can match
the IP address of the client against an ACL with the match operator.:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-default" data-lang="default"&gt;# Who is allowed to purge....
acl local {
 &amp;#34;localhost&amp;#34;;
 &amp;#34;192.168.1.0&amp;#34;/24; /* and everyone on the local network */
 ! &amp;#34;192.168.1.23&amp;#34;; /* except for the dialin router */
}

sub vcl_recv {
 if (req.method == &amp;#34;PURGE&amp;#34;) {
 if (client.ip ~ local) {
 return(purge);
 } else {
 return(synth(403, &amp;#34;Access denied.&amp;#34;));
 }
 }
}
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Adding WebSockets support</title><link>https://www.varnish.org/docs/users-guide/vcl-example-websockets/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-example-websockets/</guid><description>&lt;!-- Copyright (c) 2013-2017 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;WebSockets is a technology for creating a bidirectional stream-based
channel over HTTP.&lt;/p&gt;
&lt;p&gt;To run WebSockets through Varnish you need to pipe the request and copy
the Upgrade and Connection headers as follows:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-default" data-lang="default"&gt;sub vcl_recv {
 if (req.http.upgrade ~ &amp;#34;(?i)websocket&amp;#34;) {
 return (pipe);
 }
}

sub vcl_pipe {
 if (req.http.upgrade) {
 set bereq.http.upgrade = req.http.upgrade;
 set bereq.http.connection = req.http.connection;
 }
}
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Altering the backend response</title><link>https://www.varnish.org/docs/users-guide/vcl-example-manipulating-responses/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-example-manipulating-responses/</guid><description>&lt;!-- Copyright (c) 2013-2017 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;Here we override the TTL of a object coming from the backend if it
matches certain criteria:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-default" data-lang="default"&gt;sub vcl_backend_response {
 if (bereq.url ~ &amp;#34;\.(png|gif|jpg)$&amp;#34;) {
 unset beresp.http.set-cookie;
 set beresp.ttl = 1h;
 }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We also remove any Set-Cookie headers in order to avoid creation of a
hit-for-miss object. See &lt;a href="https://www.varnish.org/docs/reference/vcl-step/#vcl-actions"&gt;VCL Actions&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Backend servers</title><link>https://www.varnish.org/docs/users-guide/vcl-backends/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-backends/</guid><description>&lt;!-- Copyright (c) 2012-2020 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-backend-servers"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Varnish has a concept of “backend” or “origin” servers. A backend
server is the server providing the content Varnish will accelerate.&lt;/p&gt;
&lt;p&gt;Our first task is to tell Varnish where it can find its backends. Start
your favorite text editor and open the relevant VCL file.&lt;/p&gt;
&lt;p&gt;Somewhere in the top there will be a section that looks a bit like this.:&lt;/p&gt;</description></item><item><title>Built-in VCL</title><link>https://www.varnish.org/docs/users-guide/vcl-built-in-code/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-built-in-code/</guid><description>&lt;p&gt;&lt;a id="vcl-built-in-code"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Whenever a VCL program is loaded, the built-in VCL is appended to it. The
vcl built-in subs (&lt;a href="https://www.varnish.org/docs/reference/vcl-step/#id6"&gt;VCL Steps&lt;/a&gt;) have a special property, they can appear multiple
times and the result is concatenation of all built-in subroutines.&lt;/p&gt;
&lt;p&gt;For example, let’s take the following snippet:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-default" data-lang="default"&gt;sub vcl_recv {
 # loaded code for vcl_recv
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The effective VCL that is supplied to the compiler looks like:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-default" data-lang="default"&gt;sub vcl_recv {
 # loaded code for vcl_recv
 # built-in code for vcl_recv
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is how it is guaranteed that all &lt;a href="https://www.varnish.org/docs/reference/states/#reference-states"&gt;Varnish Processing States&lt;/a&gt; have at least
one &lt;code&gt;return (&amp;lt;action&amp;gt;)&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>CLI - bossing Varnish around</title><link>https://www.varnish.org/docs/users-guide/run_cli/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/run_cli/</guid><description>&lt;!-- Copyright (c) 2013-2021 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="run-cli"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once &lt;code&gt;varnishd&lt;/code&gt; is started, you can control it using the &lt;code&gt;varnishadm&lt;/code&gt;
program and the command line interface:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-default" data-lang="default"&gt;varnishadm help
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you want to run &lt;code&gt;varnishadm&lt;/code&gt; from a remote system, we recommend
you use &lt;code&gt;ssh&lt;/code&gt; into the system where &lt;code&gt;varnishd&lt;/code&gt; runs. (But see also:
&lt;a href="https://www.varnish.org/docs/reference/cli_protocol/#ref-remote-cli"&gt;Local and remote CLI connections&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;You can SSH into the &lt;code&gt;varnishd&lt;/code&gt; computer and run &lt;code&gt;varnishadm&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Compression</title><link>https://www.varnish.org/docs/users-guide/compression/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/compression/</guid><description>&lt;!-- Copyright (c) 2012-2015 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-compression"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In Varnish 3.0 we introduced native support for compression, using gzip
encoding. &lt;em&gt;Before&lt;/em&gt; 3.0, Varnish would never compress objects.&lt;/p&gt;
&lt;p&gt;In Varnish 4.0 compression defaults to “on”, meaning that it tries to
be smart and do the sensible thing.&lt;/p&gt;
&lt;p&gt;If you don’t want Varnish tampering with the encoding you can disable
compression all together by setting the parameter http_gzip_support to
false. Please see man &lt;a href="https://www.varnish.org/docs/reference/varnishd/#varnishd-1"&gt;varnishd&lt;/a&gt; for details.&lt;/p&gt;</description></item><item><title>Content composition with Edge Side Includes</title><link>https://www.varnish.org/docs/users-guide/esi/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/esi/</guid><description>&lt;!-- Copyright (c) 2012-2020 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-esi"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Varnish can create web pages by assembling different pages, called fragments,
together into one page. These fragments can have individual cache policies.
If you have a web site with a list showing the five most popular articles on
your site, this list can probably be cached as a fragment and included
in all the other pages.&lt;/p&gt;</description></item><item><title>Device detection</title><link>https://www.varnish.org/docs/users-guide/devicedetection/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/devicedetection/</guid><description>&lt;!-- Copyright (c) 2012-2020 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-devicedetect"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Device detection is figuring out what kind of content to serve to a
client based on the User-Agent string supplied in a request.&lt;/p&gt;
&lt;p&gt;Use cases for this are for example to send size reduced files to mobile
clients with small screens and on high latency networks, or to
provide a streaming video codec that the client understands.&lt;/p&gt;</description></item><item><title>Grace mode and keep</title><link>https://www.varnish.org/docs/users-guide/vcl-grace/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-grace/</guid><description>&lt;!-- Copyright (c) 2014-2020 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-handling-misbehaving-servers"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sometimes you want Varnish to serve content that is somewhat stale
instead of waiting for a fresh object from the backend. For example,
if you run a news site, serving a main page that is a few seconds old
is not a problem if this gives your site faster load times.&lt;/p&gt;</description></item><item><title>Hashing</title><link>https://www.varnish.org/docs/users-guide/vcl-hashing/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-hashing/</guid><description>&lt;!-- Copyright (c) 2012-2021 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;Internally, when Varnish stores content in the cache indexed by a hash
key used to find the object again. In the default setup
this key is calculated based on URL, the Host: header, or
if there is none, the IP address of the server:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-default" data-lang="default"&gt;sub vcl_hash {
 hash_data(req.url);
 if (req.http.host) {
 hash_data(req.http.host);
 } else {
 hash_data(server.ip);
 }
 return (lookup);
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you can see it first hashes req.url and then req.http.host if
it exists. It is worth pointing out that Varnish doesn’t lowercase the
hostname or the URL before hashing it so in theory having “Varnish.org/”
and “varnish.org/” would result in different cache entries. Browsers
however, tend to lowercase hostnames.&lt;/p&gt;</description></item><item><title>Logging in Varnish</title><link>https://www.varnish.org/docs/users-guide/operation-logging/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/operation-logging/</guid><description>&lt;!-- Copyright (c) 2012-2015 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-logging"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;One of the really nice features in Varnish is the way logging
works. Instead of logging to a normal log file Varnish logs to a shared
memory segment, called the VSL - the Varnish Shared Log. When the end
of the segment is reached we start over, overwriting old data.&lt;/p&gt;
&lt;p&gt;This is much, much faster than logging to a file and it doesn’t
require disk space. Besides it gives you much, much more information
when you need it.&lt;/p&gt;</description></item><item><title>Manipulating request headers in VCL</title><link>https://www.varnish.org/docs/users-guide/vcl-example-manipulating-headers/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-example-manipulating-headers/</guid><description>&lt;!-- Copyright (c) 2013-2015 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;Lets say we want to remove the cookie for all objects in the /images
directory of our web server:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-default" data-lang="default"&gt;sub vcl_recv {
 if (req.url ~ &amp;#34;^/images&amp;#34;) {
 unset req.http.cookie;
 }
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, when the request is handled to the backend server there will be
no cookie header. The interesting line is the one with the
if-statement. It matches the URL, taken from the request object, and
matches it against the regular expression. Note the match operator. If
it matches the Cookie: header of the request is unset (deleted).&lt;/p&gt;</description></item><item><title>Parameters</title><link>https://www.varnish.org/docs/users-guide/params/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/params/</guid><description>&lt;!-- Copyright (c) 2012-2017 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;Varnish Cache comes with a set of parameters that affects behaviour and
performance. Parameters are set either though command line
arguments to &lt;code&gt;varnishd&lt;/code&gt; or at runtime through &lt;code&gt;varnishadm&lt;/code&gt; using
the &lt;code&gt;param.set&lt;/code&gt; CLI command.&lt;/p&gt;
&lt;p&gt;We don’t recommend that you tweak parameters unless you’re sure of what
you’re doing. We’ve worked hard to make the defaults sane and Varnish
should be able to handle most workloads with the default settings.&lt;/p&gt;</description></item><item><title>Purging and banning</title><link>https://www.varnish.org/docs/users-guide/purging/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/purging/</guid><description>&lt;!-- Copyright (c) 2012-2021 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-purging"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;One of the most effective ways of increasing your hit ratio is to
increase the time-to-live (ttl) of your objects. But, as you’re aware
of, in this twitterific day of age, serving content that is outdated is
bad for business.&lt;/p&gt;
&lt;p&gt;The solution is to notify Varnish when there is fresh content
available. This can be done through three mechanisms. HTTP purging,
banning and forced cache misses. First, lets look at HTTP purging.&lt;/p&gt;</description></item><item><title>Reporting and statistics</title><link>https://www.varnish.org/docs/users-guide/report/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/report/</guid><description>&lt;!-- Copyright (c) 2013-2014 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-report"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This section covers how to find out what Varnish is doing, from
the detailed per HTTP request blow-by-blow logrecords to the global
summary statistics counters.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/operation-logging/"&gt;Logging in Varnish&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/operation-statistics/"&gt;Statistics&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/operation-statistics/#varnishtop"&gt;varnishtop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/operation-statistics/#varnishhist"&gt;varnishhist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/operation-statistics/#varnishstat"&gt;varnishstat&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Request and response VCL objects</title><link>https://www.varnish.org/docs/users-guide/vcl-variables/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-variables/</guid><description>&lt;!-- Copyright (c) 2012-2016 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;!-- XXX: refactored headline. benc --&gt;
&lt;p&gt;In VCL, there several important objects that you need to be aware of. These
objects can be accessed and manipulated using VCL.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;req&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The request object. When Varnish has received the request the req object is
created and populated. Most of the work you do in vcl_recv you
do on or with the req object.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;bereq&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The backend request object. Varnish constructs this before sending it to the
backend. It is based on the req object.&lt;/dd&gt;
&lt;/dl&gt;
&lt;!-- XXX:in what way? benc --&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;beresp&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The backend response object. It contains the headers of the object
coming from the backend. If you want to modify the response coming from the
server you modify this object in vcl_backend_response.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;resp&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The HTTP response right before it is delivered to the client. It is
typically modified in vcl_deliver.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;obj&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The object as it is stored in cache. Read only.&lt;/dd&gt;
&lt;/dl&gt;
&lt;!-- XXX:What object? the current request? benc --&gt;</description></item><item><title>Required command line arguments</title><link>https://www.varnish.org/docs/users-guide/command-line/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/command-line/</guid><description>&lt;!-- Copyright (c) 2012-2021 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-command-line"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There only one command line argument you have to provide when starting Varnish,
which is ‘-b’ for where the backend server can be contacted.&lt;/p&gt;
&lt;p&gt;‘-a’ is another argument which is likely to require adjustment.&lt;/p&gt;
&lt;p&gt;If you have installed Varnish through using a provided operating system bound package,
you will find the startup options here:&lt;/p&gt;</description></item><item><title>Security first</title><link>https://www.varnish.org/docs/users-guide/run_security/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/run_security/</guid><description>&lt;!-- Copyright (c) 2013-2021 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="run-security"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you are the only person involved in running Varnish, or if all
the people involved are trusted to the same degree, you can skip
this chapter. We have protected Varnish as well as we can from
anything which can come in through an HTTP socket.&lt;/p&gt;
&lt;p&gt;If parts of your web infrastructure are outsourced or otherwise
partitioned along administrative lines, you need to think about
security.&lt;/p&gt;</description></item><item><title>Separate VCL files</title><link>https://www.varnish.org/docs/users-guide/vcl-separate/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-separate/</guid><description>&lt;!-- Copyright (c) 2016-2019 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-separate-vcl"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Having multiple different vhosts in the same Varnish is a very
typical use-case, and from Varnish 5.0 it is possible to have
a separate VCL files for separate vhosts or any other distinct
subset of requests.&lt;/p&gt;
&lt;p&gt;Assume that we want to handle &lt;code&gt;varnish.org&lt;/code&gt; with one VCL file
and &lt;code&gt;varnish-cache.org&lt;/code&gt; with another VCL file.&lt;/p&gt;</description></item><item><title>Sizing your cache</title><link>https://www.varnish.org/docs/users-guide/sizing-your-cache/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/sizing-your-cache/</guid><description>&lt;!-- Copyright (c) 2012-2015 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;Deciding on cache size can be a tricky task. A few things to consider:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;How big is your &lt;em&gt;hot&lt;/em&gt; data set. For a portal or news site that
would be the size of the front page with all the stuff on it, and
the size of all the pages and objects linked from the first page.&lt;/li&gt;
&lt;li&gt;How expensive is it to generate an object? Sometimes it makes sense
to only cache images a little while or not to cache them at all if
they are cheap to serve from the backend and you have a limited
amount of memory.&lt;/li&gt;
&lt;li&gt;Watch the n_lru_nuked counter with &lt;a href="https://www.varnish.org/docs/reference/varnishstat/#varnishstat-1"&gt;varnishstat&lt;/a&gt; or some
other tool. If you have a lot of LRU activity then your cache is
evicting objects due to space constraints and you should consider
increasing the size of the cache.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;Also, there are additional considerations for specific storage engines
(stevedores), see &lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#guide-storage"&gt;Storage backends&lt;/a&gt; for details.&lt;/p&gt;</description></item><item><title>Starting and running Varnish</title><link>https://www.varnish.org/docs/users-guide/running/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/running/</guid><description>&lt;!-- Copyright (c) 2013-2014 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-running"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This section covers starting, running, and stopping Varnish,
command line flags and options, and communicating with the running
Varnish processes, configuring storage and sockets and, and about
securing and protecting Varnish against attacks.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/run_security/"&gt;Security first&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/run_security/#command-line-arguments"&gt;Command line arguments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/run_security/#the-cli-interface"&gt;The CLI interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/run_security/#vcl-programs"&gt;VCL programs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/run_security/#http-requests"&gt;HTTP requests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/command-line/"&gt;Required command line arguments&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/command-line/#a-name-listen-address-proto-option-value"&gt;‘-a’ &lt;em&gt;&amp;lt;[name=][listen_address[,PROTO|,option=value,…]]&amp;gt;&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/command-line/#f-vcl-file-or-b-backend"&gt;‘-f’ &lt;em&gt;VCL-file&lt;/em&gt; or ‘-b’ &lt;em&gt;backend&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/command-line/#optional-arguments"&gt;Optional arguments&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/run_cli/"&gt;CLI - bossing Varnish around&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/run_cli/#what-can-you-do-with-the-cli"&gt;What can you do with the CLI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/"&gt;Storage backends&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#intro"&gt;Intro&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#storage-selection"&gt;Storage Selection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#default"&gt;default&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#malloc"&gt;malloc&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#umem"&gt;umem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#file"&gt;file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#deprecated-persistent"&gt;deprecated_persistent&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/storage-backends/#transient-storage"&gt;Transient Storage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/params/"&gt;Parameters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/sizing-your-cache/"&gt;Sizing your cache&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Statistics</title><link>https://www.varnish.org/docs/users-guide/operation-statistics/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/operation-statistics/</guid><description>&lt;!-- Copyright (c) 2012-2015 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-guide-statistics"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Varnish comes with a couple of nifty and very useful statistics generating tools that generates statistics in real time by constantly updating and presenting a specific dataset by aggregating and analyzing logdata from the shared memory logs.&lt;/p&gt;
&lt;!-- XXX:Heavy rewrite above. benc --&gt;
&lt;h2 id="varnishtop"&gt;varnishtop&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://www.varnish.org/docs/reference/varnishtop/#varnishtop-1"&gt;varnishtop&lt;/a&gt; utility reads the shared memory logs and presents a
continuously updated list of the most commonly occurring log entries.&lt;/p&gt;</description></item><item><title>Storage backends</title><link>https://www.varnish.org/docs/users-guide/storage-backends/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/storage-backends/</guid><description>&lt;!-- Copyright (c) 2012-2020 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="guide-storage"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;
&lt;p&gt;Varnish has pluggable storage backends. It can store data in various
backends which can have different performance characteristics. The default
configuration is to use the malloc backend with a limited size. For a
serious Varnish deployment you probably would want to adjust the storage
settings.&lt;/p&gt;
&lt;p&gt;All built-in storage backends cache full objects only, so, for example, to
support &lt;em&gt;n&lt;/em&gt; concurrent cache hits on 1GB sized objects, the storage backend
should be configured to provide at least &lt;em&gt;n&lt;/em&gt;GB of storage. For uncacheable
objects, the rule of thumb is &lt;em&gt;n&lt;/em&gt; x &lt;code&gt;transit_buffer&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>The Big Varnish Picture</title><link>https://www.varnish.org/docs/users-guide/intro/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/intro/</guid><description>&lt;!-- Copyright (c) 2013-2015 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-intro"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this section we will cover answers to the questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What is in this package called “Varnish”?&lt;/li&gt;
&lt;li&gt;what are all the different bits and pieces named?&lt;/li&gt;
&lt;li&gt;Will you need a hex-wrench for assembly?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The two main parts of Varnish are the two processes in the varnishd
program. The first process is called “the manager”, and its job is to
talk to you, the administrator, and make the things you ask for
happen.&lt;/p&gt;</description></item><item><title>Troubleshooting Varnish</title><link>https://www.varnish.org/docs/users-guide/troubleshooting/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/troubleshooting/</guid><description>&lt;!-- Copyright (c) 2012-2019 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-trouble"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sometimes Varnish misbehaves or rather behaves the way you told it to
behave but not necessarily the way you want it to behave. In order for
you to understand whats going on there are a couple of places you can
check. &lt;a href="https://www.varnish.org/docs/reference/varnishlog/#varnishlog-1"&gt;varnishlog&lt;/a&gt;, &lt;code&gt;/var/log/syslog&lt;/code&gt;,
&lt;code&gt;/var/log/messages&lt;/code&gt; are all good places where Varnish might leave
clues of whats going on. This section will guide you through basic
troubleshooting in Varnish.&lt;/p&gt;</description></item><item><title>Using inline C to extend Varnish</title><link>https://www.varnish.org/docs/users-guide/vcl-inline-c/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-inline-c/</guid><description>&lt;!-- Copyright (c) 2012-2015 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;(Here there be dragons. Big and mean ones.)&lt;/p&gt;
&lt;p&gt;You can use &lt;em&gt;inline C&lt;/em&gt; to extend Varnish. Please note that you can
seriously mess up Varnish this way. The C code runs within the Varnish
Cache process so if your code generates a segfault the cache will crash.&lt;/p&gt;
&lt;p&gt;One of the first uses of inline C was logging to syslog.:&lt;/p&gt;</description></item><item><title>Varnish and Website Performance</title><link>https://www.varnish.org/docs/users-guide/performance/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/performance/</guid><description>&lt;!-- Copyright (c) 2013-2019 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-performance"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This section focuses on how to tune the performance of your Varnish server,
and how to tune the performance of your website using Varnish.&lt;/p&gt;
&lt;p&gt;The section is split in three subsections. The first subsection deals with the
various tools and functions of Varnish that you should be aware of. The next
subsection focuses on the how to purge content out of your cache. Purging of
content is essential in a performance context because it allows you to extend
the &lt;em&gt;time-to-live&lt;/em&gt; (TTL) of your cached objects. Having a long TTL allows
Varnish to keep the content in cache longer, meaning Varnish will make fewer
requests to your relatively slower backend.&lt;/p&gt;</description></item><item><title>VCL - Varnish Configuration Language</title><link>https://www.varnish.org/docs/users-guide/vcl/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl/</guid><description>&lt;!-- Copyright (c) 2012-2016 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;&lt;a id="users-vcl"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This section covers how to tell Varnish how to handle
your HTTP traffic, using the Varnish Configuration Language (VCL).&lt;/p&gt;
&lt;p&gt;Varnish has a great configuration system. Most other systems use
configuration directives, where you basically turn on and off lots of
switches. We have instead chosen to use a domain specific language called VCL for this.&lt;/p&gt;</description></item><item><title>VCL Examples</title><link>https://www.varnish.org/docs/users-guide/vcl-examples/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-examples/</guid><description>&lt;!-- Copyright (c) 2012-2014 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;These are a short collection of examples that showcase some of the
capabilities of the VCL language.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/vcl-example-manipulating-headers/"&gt;Manipulating request headers in VCL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/vcl-example-manipulating-responses/"&gt;Altering the backend response&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/vcl-example-acls/"&gt;ACLs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.varnish.org/docs/users-guide/vcl-example-websockets/"&gt;Adding WebSockets support&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>VCL Syntax</title><link>https://www.varnish.org/docs/users-guide/vcl-syntax/</link><pubDate>Mon, 16 Mar 2026 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/users-guide/vcl-syntax/</guid><description>&lt;!-- Copyright (c) 2012-2020 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license --&gt;
&lt;p&gt;VCL has inherited a lot from C and it reads much like simple C or Perl.&lt;/p&gt;
&lt;p&gt;Blocks are delimited by curly brackets, statements end with semicolons,
and comments may be written as in C, C++ or Perl according to your own
preferences.&lt;/p&gt;
&lt;p&gt;Note that VCL doesn’t contain any loops or jump statements.&lt;/p&gt;</description></item></channel></rss>