Commit 3441f414 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp
parents bd007e83 96527057
This diff is collapsed.
......@@ -15,12 +15,13 @@ Control a running varnish instance
SYNOPSIS
========
varnishadm [-t timeout] [-S secret_file] -T address:port [command [...]]
varnishadm [-t timeout] [-S secret_file] [-T address:port] [-n name] [command [...]]
DESCRIPTION
===========
The varnishadm utility establishes a CLI connection using the -T and -S arguments.
The varnishadm utility establishes a CLI connection to varnishd either
using -n *name* or using the -T and -S arguments. If -n *name* is the location of the secret file and the address:port is looked up in shared memory. If neither is given varnishadm will look for an instance without a given name.
If a command is given, the command and arguments are sent over the CLI
connection and the result returned on stdout.
......@@ -42,6 +43,8 @@ OPTIONS
-T address:port
Connect to the management interface at the specified address and port.
-n name
Connect to the instance of varnishd with this name.
Available commands and parameters are documented in the varnishd(1)
manual page. Additionally, a summary of commands can be obtained by
......
......@@ -93,6 +93,10 @@ OPTIONS
Offer a management interface on the specified address and port. See Management
Interface for a list of management commands.
-M address:port
Connect to this port and offer the command line
interface. Think of it as a reverse shell.
-t ttl
Specifies a hard minimum time to live for cached documents. This is a shortcut for
specifying the default_ttl run-time parameter.
......@@ -204,85 +208,9 @@ Management Interface
--------------------
If the -T option was specified, varnishd will offer a command-line management interface on the specified address
and port. The following commands are available:
help [command]
Display a list of available commands.
If the command is specified, display help for this command.
param.set param value
Set the parameter specified by param to the specified value. See Run-Time Parameters for a list of parame‐
ters.
param.show [-l] [param]
Display a list if run-time parameters and their values.
If the -l option is specified, the list includes a brief explanation of each parameter.
If a param is specified, display only the value and explanation for this parameter.
ping [timestamp]
Ping the Varnish cache process, keeping the connection alive.
purge field operator argument [&& field operator argument [...]]
Immediately invalidate all documents matching the purge expression. See Purge expressions for more docu‐
mentation and examples.
purge.list
Display the purge list.
All requests for objects from the cache are matched against items on the purge list. If an object in the
cache is older than a matching purge list item, it is considered "purged", and will be fetched from the
backend instead.
When a purge expression is older than all the objects in the cache, it is removed from the list.
purge.url regexp
Immediately invalidate all documents whose URL matches the specified regular expression.
quit
Close the connection to the varnish admin port.
start
Start the Varnish cache process if it is not already running.
stats
Show summary statistics.
All the numbers presented are totals since server startup; for a better idea of the current situation, use
the varnishstat(1) utility.
status
Check the status of the Varnish cache process.
stop
Stop the Varnish cache process.
and port. The recommended way of connecting to the command-line management interface is through varnishadm(1).
url.purge regexp
Deprecated, see purge.url instead.
vcl.discard configname
Discard the configuration specified by configname. This will have no effect if the specified configuration
has a non-zero reference count.
vcl.inline configname vcl
Create a new configuration named configname with the VCL code specified by vcl, which must be a quoted
string.
vcl.list
List available configurations and their respective reference counts. The active configuration is indicated
with an asterisk ("*").
vcl.load configname filename
Create a new configuration named configname with the contents of the specified file.
vcl.show configname
Display the source code for the specified configuration.
vcl.use configname
Start using the configuration specified by configname for all new requests. Existing requests will con‐
tinue using whichever configuration was in use when they arrived.
The commands available are documented in varnish(7).
Run-Time Parameters
-------------------
......@@ -835,41 +763,6 @@ waiter
Select the waiter kernel interface.
Purge expressions
-----------------
A purge expression consists of one or more conditions. A condition
consists of a field, an operator, and an argument. Conditions can be
ANDed together with "&&".
A field can be any of the variables from VCL, for instance req.url,
req.http.host or obj.set-cookie.
Operators are "==" for direct comparision, "~" for a regular
expression match, and ">" or "<" for size comparisons. Prepending
an operator with "!" negates the expression.
The argument could be a quoted string, a regexp, or an integer.
Integers can have "KB", "MB", "GB" or "TB" appended for size related
fields.
Simple example: All requests where req.url exactly matches the string
/news are purged from the cache:::
req.url == "/news"
Example: Purge all documents where the name does not end with ".ogg",
and where the size of the object is greater than 10 megabytes:::
req.url !~ "\.ogg$" && obj.size > 10MB
Example: Purge all documents where the serving host is "example.com"
or "www.example.com", and where the Set- Cookie header received from
the backend contains "USERID=1663":::
req.http.host ~ "^(?i)(www\.)example.com$" && obj.set-cookie ~ "USERID=1663"
SEE ALSO
========
......
......@@ -35,16 +35,15 @@ Blocks are delimited by curly braces, statements end with semicolons,
and comments may be written as in C, C++ or Perl according to your own
preferences.
In addition to the C-like assignment (=), comparison (==) and boolean
(!, && and \|\|) operators, VCL supports regular expression and ACL
matching using the ~ operator.
In addition to the C-like assignment (=), comparison (==, !=) and
boolean (!, && and \|\|) operators, VCL supports both regular
expression and ACL matching using the ~ and the !~ operators.
Unlike C and Perl, the backslash (\) character has no special meaning
in strings in VCL, so it can be freely used in regular expressions
without doubling.
Strings are concatenated by putting them one after each other
with a '+' operator between.
Strings are concatenated using the '+' operator.
Assignments are introduced with the *set* keyword. There are no
user-defined variables; values can only be assigned to variables
......
......@@ -168,6 +168,18 @@ beresp.ttl to whatever you want::
}
}
The example will set the TTL to 5 days for the old legacy stuff on
your site.
Forcing caching for certain requests and certain responses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Since you still have this cumbersome backend that isn't very friendly
to work with you might want to override more stuff in Varnish. We
recommend that you rely as much as you can on the default caching
rules. It is perfectly easy to force Varnish to lookup an object in
the cache but it isn't really recommended.
Normalizing your namespace
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment