..
Copyright (c) 2021 Varnish Software AS
SPDX-License-Identifier: BSD-2-Clause
See LICENSE file for full text of license
.. role:: ref(emphasis)
.. _vcl-var(7):
=============
VCL-Variables
=============
------------------
The complete album
------------------
:Manual section: 7
DESCRIPTION
===========
This is a list of all variables in the VCL language.
Variable names take the form ``scope.variable[.index]``, for instance::
req.url
beresp.http.date
client.ip
Which operations are possible on each variable is described below,
often with the shorthand "backend" which covers the ``vcl_backend_* {}``
subroutines and "client" which covers the rest, except ``vcl_init {}``
and ``vcl_fini {}``.
.. include:: vcl_var.rst
.. _protected_headers:
Protected header fields
-----------------------
The ``content-length`` and ``transfer-encoding`` headers are read-only. They
must be preserved to ensure HTTP/1 framing remains consistent and maintain a
proper request and response synchronization with both clients and backends.
VMODs can still update these headers, when there is a reason to change the
framing, such as a transformation of a request or response body.
HTTP response status
--------------------
A HTTP status code has 3 digits XYZ where X must be between 1 and 5 included.
Since it is not uncommon to see HTTP clients or servers relying
on non-standard or even invalid status codes, Varnish can work
with any status between 100 and 999.
Within VCL code it is even possible to use status codes in the form
VWXYZ as long as the overall value is lower than 65536, but only
the XYZ part will be sent to the client, by which time the X must
also have become non-zero.
The VWXYZ form of status codes can be communicate extra information
in ``resp.status`` and ``beresp.status`` to ``return(synth(...))`` and
``return(error(...))``, to indicate which synthetic content to produce::
sub vcl_recv {
if ([...]) {
return synth(12404);
}
}
sub vcl_synth {
if (resp.status == 12404) {
[...] // this specific 404
} else if (resp.status % 1000 == 404) {
[...] // all other 404's
}
}
The ``obj.status`` variable will inherit the VWXYZ form, but in a ban
expression only the XYZ part will be available. The VWXYZ form is strictly
limited to VCL execution.
Assigning an HTTP standardized code to ``resp.status`` or ``beresp.status``
will also set ``resp.reason`` or ``beresp.reason`` to the corresponding
status message.
304 handling
~~~~~~~~~~~~
For a 304 response, Varnish core code amends ``beresp`` before calling
`vcl_backend_response`:
* If the gzip status changed, ``Content-Encoding`` is unset and any
``Etag`` is weakened
* Any headers not present in the 304 response are copied from the
existing cache object. ``Content-Length`` is copied if present in
the existing cache object and discarded otherwise.
* The status gets set to 200.
`beresp.was_304` marks that this conditional response processing has
happened.
Note: Backend conditional requests are independent of client
conditional requests, so clients may receive 304 responses no matter
if a backend request was conditional.
beresp.ttl / beresp.grace / beresp.keep
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Before calling `vcl_backend_response`, core code sets ``beresp.ttl``
based on the response status and the response headers ``Age``,
``Cache-Control`` or ``Expires`` and ``Date`` as follows:
* If present and valid, the value of the ``Age`` header is effectively
deduced from all ttl calculations.
* For status codes 200, 203, 204, 300, 301, 304, 404, 410 and 414:
* If ``Cache-Control`` contains an ``s-maxage`` or ``max-age`` field
(in that order of preference), the ttl is set to the respective
non-negative value or 0 if negative.
* Otherwise, if no ``Expires`` header exists, the default ttl is
used.
* Otherwise, if ``Expires`` contains a time stamp before ``Date``,
the ttl is set to 0.
* Otherwise, if no ``Date`` header is present or the ``Date`` header
timestamp differs from the local clock by no more than the
`clock_skew` parameter, the ttl is set to
* 0 if ``Expires`` denotes a past timestamp or
* the difference between the local clock and the ``Expires``
header otherwise.
* Otherwise, the ttl is set to the difference between ``Expires``
and ``Date``
* For status codes 302 and 307, the calculation is identical except
that the default ttl is not used and -1 is returned if neither
``Cache-Control`` nor ``Expires`` exists.
* For all other status codes, ttl -1 is returned.
``beresp.grace`` defaults to the `default_grace` parameter.
For a non-negative ttl, if ``Cache-Control`` contains a
``stale-while-revalidate`` field value, ``beresp.grace`` is
set to that value if non-negative or 0 otherwise.
``beresp.keep`` defaults to the `default_keep` parameter.
SEE ALSO
========
* :ref:`varnishd(1)`
* :ref:`vcl(7)`
HISTORY
=======
VCL was developed by Poul-Henning Kamp in cooperation with Verdens
Gang AS, Redpill Linpro and Varnish Software. This manual page is
written by Per Buer, Poul-Henning Kamp, Martin Blix Grydeland,
Kristian Lyngst?l, Lasse Karstensen and others.
COPYRIGHT
=========
This document is licensed under the same license as Varnish
itself. See LICENSE for details.
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2021 Varnish Software AS
Henceforth, whatever our philosopher says about Matter will apply to extension and to extension alone. It cannot be apprehended by sight, nor by hearing, nor by smell, nor by taste, for it is neither colour, nor sound, nor odour, nor juice. Neither can it be touched, for it is not a body, but it becomes corporeal on being blended with sensible qualities. And, in a later essay, he describes it as receiving all things and letting them depart again without retaining the slightest trace of their presence.483 Why then, it may be asked, if Plotinus meant extension, could he not say so at once, and save us all this trouble in hunting out his meaning? There were very good reasons why he should not. In the first place, he wished to express himself, so far as possible, in Aristotelian phraseology, and this was incompatible with the reduction of Matter to extension. In the next place, the idea of an infinite void had been already appropriated by the Epicureans, to whose system he was bitterly opposed. And, finally, the extension of ordinary327 experience had not the absolute generality which was needed in order to bring Matter into relation with that ultimate abstraction whence, like everything else, it has now to be derived. That the millionaire was genuine, ¡°in person and not a caricature,¡± as Dick put it, was evident. Both the nurse, his relative, and his wife, were chatting with him as Jeff delivered the heavy packed ball made up of the gum. 233 "I guess not," said Landor, tolerantly, as he turned[Pg 106] his horse over to his orderly; "but, anyway," he added to Ellton, "we had a picnic¡ªof a sort." Si, unable to think of anything better, went with him. The train had stopped on a switch, and seemed likely to rust fast to the rails, from the way other trains were going by in both directions. The bridge gang, under charge of a burly, red-faced young Englishman, was in the rear car, with their tools, equipments, bedding and cooking utensils. THE DEACON HAS SOME EXPERIENCES WITH THE QUADRUPED. "You are not within a mile of the truth. I know it. Look here: I believe that is Gen. Rosecrans's own cow. She's gone, and I got an order to look around for her. I've never seen her, but from the description given me I believe that's she. Who brought her here?" "Deacon, these brothers and sisters who have come here with me to-night are, like myself, deeply interested in the moral condition of the army, where we all have sons or kinsmen. Now, can't you sit right there and tell us of your observations and experiences, as a Christian man and father, from day to day, of every day that you were down there? Tell us everything, just as it happened each day, that we may be able to judge for ourselves." HAS AN ENCOUNTER WITH THE PROVOST-MARSHAL. "Wonder which one o' them is the 200th Injianny's?" said Si to Shorty. "And your mother, and Harry?" The daughter must be the girl who was talking to him now. She sat on a little stool by the fire, and had brought out some sewing. "Over at Grandturzel¡ªcan't see wot's burning from here. Git buckets and come!" These things, however, gave little concern to the worthy who commanded the Kentish division. Tyler, though an excellent blacksmith, possessed few of the qualities requisite for forming a good general. Provided there was no very sensible diminution in the number of his followers, he cared not a straw for the score or two who, after quarrelling, or perhaps fighting, withdrew in such disgust that they vowed rather to pay the full tax for ever than submit to the insolence of the rebels. One man could fight as well as another, reasoned he; and, provided he was obeyed, what mattered it by whom. Dick went and Tom came¡ªit was sure to be all one in the end. But this burst of indignation soon passed away, and upon the suggestion of the prudent Sir Robert Hailes, he sent an evasive answer, with a command that the Commons should attend him at Windsor on the Sunday following. That it was a stratagem to gain entrance to the Tower, was the opinion of several, but, after much discussion, it was decided that the man should be admitted, and that the monk should be exhibited merely to intimidate the rebels, until the result of this promised communication should be known. HoMEŮͬÐÔÁµcbcb
ENTER NUMBET 0017
xiguanla.com.cn
www.zeye6.net.cn
mezi8.com.cn
sjxhzj.com.cn
www.wutiba.com.cn
mclz.net.cn
www.yanmi6.net.cn
nj9424.com.cn
maoan8.com.cn
www.benma3.com.cn