Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
c9598deb
Commit
c9598deb
authored
Oct 04, 2016
by
Nils Goroll
Committed by
Pål Hermunn Johansen
Oct 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
document bereq preparation in core
(Backport of
2bbcde1d
with the fix
b698aec2
squashed in) doc fixes #2107
parent
2c4ceead
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
vcl-built-in-subs.rst
doc/sphinx/users-guide/vcl-built-in-subs.rst
+28
-0
No files found.
doc/sphinx/users-guide/vcl-built-in-subs.rst
View file @
c9598deb
...
...
@@ -271,6 +271,34 @@ The `vcl_backend_fetch` subroutine may terminate with calling
background fetch, control is passed to :ref:`vcl_synth` on the
client side with ``resp.status`` preset to 503.
Before calling `vcl_backend_fetch`, varnish core prepares the `bereq`
backend request as follows:
* Unless the request is a `pass`,
* set ``bereq.method`` to ``GET`` and ``bereq.proto`` to
``HTTP/1.1`` and
* set ``bereq.http.Accept_Encoding`` to ``gzip`` if
:ref:`ref_param_http_gzip_support` is enabled.
* If there is an existing cache object to be revalidated, set
``bereq.http.If-Modified-Since`` from its ``Last-Modified`` header
and/or set ``bereq.http.If-None-Match`` from its ``Etag`` header
* Set ``bereq.http.X-Varnish`` to the current transaction id (`vxid`)
These changes can be undone or modified in `vcl_backend_fetch` before
the backend request is issued.
In particular, to cache non-GET requests, ``req.method`` needs to be
saved to a header or variable in :ref:`vcl_recv` and restored to
``bereq.method``. Notice that caching non-GET requests typically also
requires changing the cache key in :ref:`vcl_hash` e.g. by also
hashing the request method and/or request body.
HEAD request can be satisfied from cached GET responses.
.. _vcl_backend_response:
vcl_backend_response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment