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
b130914d
Commit
b130914d
authored
Mar 06, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RFC2616_Ttl() in english
Feel free to improve further!
parent
5dd54f83
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
vcl-built-in-subs.rst
doc/sphinx/users-guide/vcl-built-in-subs.rst
+46
-0
No files found.
doc/sphinx/users-guide/vcl-built-in-subs.rst
View file @
b130914d
...
...
@@ -403,6 +403,52 @@ Note: Backend conditional requests are independent of client
conditional requests, so clients may receive 304 responses no matter
if a backend request was conditional.
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, 401, 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.
The `vcl_backend_response` subroutine may terminate with calling
``return()`` with one of the following keywords:
...
...
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