⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.96
Server IP:
147.93.97.220
Server:
Linux srv843233 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
varnish
/
html
/
reference
/
View File Name :
vmod_std.html
<!DOCTYPE html> <html lang="en" data-content_root="../"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <title>VMOD std - Varnish Standard Module — Varnish version 7.5.0 documentation</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" /> <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=e2714048" /> <script src="../_static/documentation_options.js?v=8214db13"></script> <script src="../_static/doctools.js?v=888ff710"></script> <script src="../_static/sphinx_highlight.js?v=dc90522c"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="VMOD unix - Utilities for Unix domain sockets" href="vmod_unix.html" /> <link rel="prev" title="VMOD purge - Varnish Purge Module" href="vmod_purge.html" /> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="vmod_unix.html" title="VMOD unix - Utilities for Unix domain sockets" accesskey="N">next</a> |</li> <li class="right" > <a href="vmod_purge.html" title="VMOD purge - Varnish Purge Module" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 7.5.0 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Varnish Reference Manual</a> »</li> <li class="nav-item nav-item-this"><a href="">VMOD std - Varnish Standard Module</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="vmod-std-varnish-standard-module"> <span id="vmod-std-3"></span><h1>VMOD std - Varnish Standard Module<a class="headerlink" href="#vmod-std-varnish-standard-module" title="Link to this heading">¶</a></h1> <section id="synopsis"> <h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Link to this heading">¶</a></h2> <pre class="literal-block">import std [as name] [from "path"] <a class="reference internal" href="#std-random"><span class="std std-ref">REAL random(REAL lo, REAL hi)</span></a> <a class="reference internal" href="#std-round"><span class="std std-ref">REAL round(REAL r)</span></a> <a class="reference internal" href="#std-collect"><span class="std std-ref">VOID collect(HEADER hdr, STRING sep=”, “)</span></a> <a class="reference internal" href="#std-querysort"><span class="std std-ref">STRING querysort(STRING)</span></a> <a class="reference internal" href="#std-toupper"><span class="std std-ref">STRING toupper(STRING s)</span></a> <a class="reference internal" href="#std-tolower"><span class="std std-ref">STRING tolower(STRING s)</span></a> <a class="reference internal" href="#std-strstr"><span class="std std-ref">STRING strstr(STRING s1, STRING s2)</span></a> <a class="reference internal" href="#std-fnmatch"><span class="std std-ref">BOOL fnmatch(STRING pattern, STRING subject, BOOL pathname, BOOL noescape, BOOL period)</span></a> <a class="reference internal" href="#std-fileread"><span class="std std-ref">STRING fileread(STRING)</span></a> <a class="reference internal" href="#std-blobread"><span class="std std-ref">BLOB blobread(STRING)</span></a> <a class="reference internal" href="#std-file-exists"><span class="std std-ref">BOOL file_exists(STRING path)</span></a> <a class="reference internal" href="#std-healthy"><span class="std std-ref">BOOL healthy(BACKEND be)</span></a> <a class="reference internal" href="#std-port"><span class="std std-ref">INT port(IP ip)</span></a> <a class="reference internal" href="#std-duration"><span class="std std-ref">DURATION duration([STRING s], [DURATION fallback], [REAL real], [INT integer])</span></a> <a class="reference internal" href="#std-bytes"><span class="std std-ref">BYTES bytes([STRING s], [BYTES fallback], [REAL real], [INT integer])</span></a> <a class="reference internal" href="#std-integer"><span class="std std-ref">INT integer([STRING s], [INT fallback], [BOOL bool], [BYTES bytes], [DURATION duration], [REAL real], [TIME time])</span></a> <a class="reference internal" href="#std-ip"><span class="std std-ref">IP ip(STRING s, [IP fallback], BOOL resolve=1, [STRING p])</span></a> <a class="reference internal" href="#std-real"><span class="std std-ref">REAL real([STRING s], [REAL fallback], [INT integer], [BOOL bool], [BYTES bytes], [DURATION duration], [TIME time])</span></a> <a class="reference internal" href="#std-time"><span class="std std-ref">TIME time([STRING s], [TIME fallback], [REAL real], [INT integer])</span></a> <a class="reference internal" href="#std-strftime"><span class="std std-ref">STRING strftime(TIME time, STRING format)</span></a> <a class="reference internal" href="#std-log"><span class="std std-ref">VOID log(STRING s)</span></a> <a class="reference internal" href="#std-syslog"><span class="std std-ref">VOID syslog(INT priority, STRING s)</span></a> <a class="reference internal" href="#std-timestamp"><span class="std std-ref">VOID timestamp(STRING s)</span></a> <a class="reference internal" href="#std-syntax"><span class="std std-ref">BOOL syntax(REAL)</span></a> <a class="reference internal" href="#std-getenv"><span class="std std-ref">STRING getenv(STRING name)</span></a> <a class="reference internal" href="#std-cache-req-body"><span class="std std-ref">BOOL cache_req_body(BYTES size)</span></a> <a class="reference internal" href="#std-late-100-continue"><span class="std std-ref">VOID late_100_continue(BOOL late)</span></a> <a class="reference internal" href="#std-set-ip-tos"><span class="std std-ref">VOID set_ip_tos(INT tos)</span></a> <a class="reference internal" href="#std-rollback"><span class="std std-ref">VOID rollback(HTTP h)</span></a> <a class="reference internal" href="#std-ban"><span class="std std-ref">BOOL ban(STRING)</span></a> <a class="reference internal" href="#std-ban-error"><span class="std std-ref">STRING ban_error()</span></a> <a class="reference internal" href="#std-now"><span class="std std-ref">TIME now()</span></a> <a class="reference internal" href="#std-timed-call"><span class="std std-ref">DURATION timed_call(SUB)</span></a> <a class="reference internal" href="#std-real2integer"><span class="std std-ref">INT real2integer(REAL r, INT fallback)</span></a> <a class="reference internal" href="#std-real2time"><span class="std std-ref">TIME real2time(REAL r, TIME fallback)</span></a> <a class="reference internal" href="#std-time2integer"><span class="std std-ref">INT time2integer(TIME t, INT fallback)</span></a> <a class="reference internal" href="#std-time2real"><span class="std std-ref">REAL time2real(TIME t, REAL fallback)</span></a></pre> </section> <section id="description"> <h2>DESCRIPTION<a class="headerlink" href="#description" title="Link to this heading">¶</a></h2> <p><em>vmod_std</em> contains basic functions which are part and parcel of Varnish, but which for reasons of architecture fit better in a VMOD.</p> </section> <section id="numeric-functions"> <h2>Numeric functions<a class="headerlink" href="#numeric-functions" title="Link to this heading">¶</a></h2> <section id="real-random-real-lo-real-hi"> <span id="std-random"></span><h3>REAL random(REAL lo, REAL hi)<a class="headerlink" href="#real-random-real-lo-real-hi" title="Link to this heading">¶</a></h3> <p>Returns a random real number between <em>lo</em> and <em>hi</em>.</p> <p>This function uses the “testable” random generator in varnishd which enables deterministic tests to be run (See <code class="docutils literal notranslate"><span class="pre">debug.srandom</span></code> CLI command). This function should not be used for cryptographic applications.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">beresp</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">random</span><span class="o">-</span><span class="n">number</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">random</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">100</span><span class="p">);</span> </pre></div> </div> </section> <section id="real-round-real-r"> <span id="std-round"></span><h3>REAL round(REAL r)<a class="headerlink" href="#real-round-real-r" title="Link to this heading">¶</a></h3> <p>Rounds the real <em>r</em> to the nearest integer, but round halfway cases away from zero (see <cite>round(3)</cite>).</p> </section> </section> <section id="string-functions"> <h2>String functions<a class="headerlink" href="#string-functions" title="Link to this heading">¶</a></h2> <section id="void-collect-header-hdr-string-sep"> <span id="std-collect"></span><h3>VOID collect(HEADER hdr, STRING sep=”, “)<a class="headerlink" href="#void-collect-header-hdr-string-sep" title="Link to this heading">¶</a></h3> <p>Collapses multiple <em>hdr</em> headers into one long header. The default separator <em>sep</em> is the standard comma separator to use when collapsing headers, with an additional whitespace for pretty printing.</p> <p>Care should be taken when collapsing headers. In particular collapsing <code class="docutils literal notranslate"><span class="pre">Set-Cookie</span></code> will lead to unexpected results on the browser side.</p> <p>Using <em>hdr</em> from <code class="docutils literal notranslate"><span class="pre">obj.http</span></code> triggers a VCL failure.</p> <p>Examples:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">collect</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">accept</span><span class="p">);</span> <span class="n">std</span><span class="o">.</span><span class="n">collect</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">cookie</span><span class="p">,</span> <span class="s2">"; "</span><span class="p">);</span> </pre></div> </div> </section> <section id="string-querysort-string"> <span id="std-querysort"></span><h3>STRING querysort(STRING)<a class="headerlink" href="#string-querysort-string" title="Link to this heading">¶</a></h3> <p>Sorts the query string for cache normalization purposes.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">url</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">querysort</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">url</span><span class="p">);</span> </pre></div> </div> </section> <section id="string-toupper-string-s"> <span id="std-toupper"></span><h3>STRING toupper(STRING s)<a class="headerlink" href="#string-toupper-string-s" title="Link to this heading">¶</a></h3> <p>Converts the string <em>s</em> to uppercase.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">beresp</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">scream</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">toupper</span><span class="p">(</span><span class="s2">"yes!"</span><span class="p">);</span> </pre></div> </div> </section> <section id="string-tolower-string-s"> <span id="std-tolower"></span><h3>STRING tolower(STRING s)<a class="headerlink" href="#string-tolower-string-s" title="Link to this heading">¶</a></h3> <p>Converts the string <em>s</em> to lowercase.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">beresp</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">nice</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">tolower</span><span class="p">(</span><span class="s2">"VerY"</span><span class="p">);</span> </pre></div> </div> </section> <section id="string-strstr-string-s1-string-s2"> <span id="std-strstr"></span><h3>STRING strstr(STRING s1, STRING s2)<a class="headerlink" href="#string-strstr-string-s1-string-s2" title="Link to this heading">¶</a></h3> <p>Returns a string beginning at the first occurrence of the string <em>s2</em> in the string <em>s1</em>, or an empty string if <em>s2</em> is not found.</p> <p>Note that the comparison is case sensitive.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">strstr</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">url</span><span class="p">,</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">restrict</span><span class="p">))</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> </pre></div> </div> <p>This will check if the content of <code class="docutils literal notranslate"><span class="pre">req.http.restrict</span></code> occurs anywhere in <code class="docutils literal notranslate"><span class="pre">req.url</span></code>.</p> </section> <section id="bool-fnmatch-string-pattern-string-subject-bool-pathname-bool-noescape-bool-period"> <span id="std-fnmatch"></span><h3>BOOL fnmatch(STRING pattern, STRING subject, BOOL pathname, BOOL noescape, BOOL period)<a class="headerlink" href="#bool-fnmatch-string-pattern-string-subject-bool-pathname-bool-noescape-bool-period" title="Link to this heading">¶</a></h3> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">BOOL</span> <span class="n">fnmatch</span><span class="p">(</span> <span class="n">STRING</span> <span class="n">pattern</span><span class="p">,</span> <span class="n">STRING</span> <span class="n">subject</span><span class="p">,</span> <span class="n">BOOL</span> <span class="n">pathname</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">BOOL</span> <span class="n">noescape</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">BOOL</span> <span class="n">period</span><span class="o">=</span><span class="mi">0</span> <span class="p">)</span> </pre></div> </div> <p>Shell-style pattern matching; returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if <em>subject</em> matches <em>pattern</em>, where <em>pattern</em> may contain wildcard characters such as <code class="docutils literal notranslate"><span class="pre">*</span></code> or <code class="docutils literal notranslate"><span class="pre">?</span></code>.</p> <p>The match is executed by the implementation of <cite>fnmatch(3)</cite> on your system. The rules for pattern matching on most systems include the following:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">*</span></code> matches any sequence of characters</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">?</span></code> matches a single character</p></li> <li><p>a bracket expression such as <code class="docutils literal notranslate"><span class="pre">[abc]</span></code> or <code class="docutils literal notranslate"><span class="pre">[!0-9]</span></code> is interpreted as a character class according to the rules of basic regular expressions (<em>not</em> <cite>pcre2(3)</cite> regexen), except that <code class="docutils literal notranslate"><span class="pre">!</span></code> is used for character class negation instead of <code class="docutils literal notranslate"><span class="pre">^</span></code>.</p></li> </ul> <p>If <em>pathname</em> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, then the forward slash character <code class="docutils literal notranslate"><span class="pre">/</span></code> is only matched literally, and never matches <code class="docutils literal notranslate"><span class="pre">*</span></code>, <code class="docutils literal notranslate"><span class="pre">?</span></code> or a bracket expression. Otherwise, <code class="docutils literal notranslate"><span class="pre">/</span></code> may match one of those patterns. By default, <em>pathname</em> is <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p> <p>If <em>noescape</em> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, then the backslash character <code class="docutils literal notranslate"><span class="pre">\</span></code> is matched as an ordinary character. Otherwise, <code class="docutils literal notranslate"><span class="pre">\</span></code> is an escape character, and matches the character that follows it in the <em>pattern</em>. For example, <code class="docutils literal notranslate"><span class="pre">\\</span></code> matches <code class="docutils literal notranslate"><span class="pre">\</span></code> when <em>noescape</em> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, and <code class="docutils literal notranslate"><span class="pre">\\</span></code> when <code class="docutils literal notranslate"><span class="pre">false</span></code>. By default, <em>noescape</em> is <code class="docutils literal notranslate"><span class="pre">false</span></code>.</p> <p>If <em>period</em> is <code class="docutils literal notranslate"><span class="pre">true</span></code>, then a leading period character <code class="docutils literal notranslate"><span class="pre">.</span></code> only matches literally, and never matches <code class="docutils literal notranslate"><span class="pre">*</span></code>, <code class="docutils literal notranslate"><span class="pre">?</span></code> or a bracket expression. A period is leading if it is the first character in <em>subject</em>; if <em>pathname</em> is also <code class="docutils literal notranslate"><span class="pre">true</span></code>, then a period that immediately follows a <code class="docutils literal notranslate"><span class="pre">/</span></code> is also leading (as in <code class="docutils literal notranslate"><span class="pre">/.</span></code>). By default, <em>period</em> is <code class="docutils literal notranslate"><span class="pre">false</span></code>.</p> <p><a class="reference internal" href="#std-fnmatch">std.fnmatch()</a> invokes VCL failure and returns <code class="docutils literal notranslate"><span class="pre">false</span></code> if either of <em>pattern</em> or <em>subject</em> is <code class="docutils literal notranslate"><span class="pre">NULL</span></code> – for example, if an unset header is specified.</p> <p>Examples:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Matches URLs such as /foo/bar and /foo/baz</span> <span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="s2">"/foo/\*"</span><span class="p">,</span> <span class="n">req</span><span class="o">.</span><span class="n">url</span><span class="p">))</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> <span class="c1"># Matches URLs such as /foo/bar/baz and /foo/baz/quux</span> <span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="s2">"/foo/\*/\*"</span><span class="p">,</span> <span class="n">bereq</span><span class="o">.</span><span class="n">url</span><span class="p">))</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> <span class="c1"># Matches /foo/bar/quux, but not /foo/bar/baz/quux</span> <span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="s2">"/foo/\*/quux"</span><span class="p">,</span> <span class="n">req</span><span class="o">.</span><span class="n">url</span><span class="p">))</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> <span class="c1"># Matches /foo/bar/quux and /foo/bar/baz/quux</span> <span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="s2">"/foo/\*/quux"</span><span class="p">,</span> <span class="n">req</span><span class="o">.</span><span class="n">url</span><span class="p">,</span> <span class="n">pathname</span><span class="o">=</span><span class="n">false</span><span class="p">))</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> <span class="c1"># Matches /foo/bar, /foo/car and /foo/far</span> <span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="s2">"/foo/?ar"</span><span class="p">,</span> <span class="n">req</span><span class="o">.</span><span class="n">url</span><span class="p">))</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> <span class="c1"># Matches /foo/ followed by a non-digit</span> <span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">fnmatch</span><span class="p">(</span><span class="s2">"/foo/[!0-9]"</span><span class="p">,</span> <span class="n">req</span><span class="o">.</span><span class="n">url</span><span class="p">))</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> </pre></div> </div> </section> </section> <section id="file-system-functions"> <h2>File(system) functions<a class="headerlink" href="#file-system-functions" title="Link to this heading">¶</a></h2> <section id="string-fileread-string"> <span id="std-fileread"></span><h3>STRING fileread(STRING)<a class="headerlink" href="#string-fileread-string" title="Link to this heading">¶</a></h3> <p>Reads a text file and returns a string with the content.</p> <p>The entire file is cached on the first call, and subsequent calls will return this cached contents, even if the file has changed in the meantime.</p> <p>For binary files, use std.blobread() instead.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">synthetic</span><span class="p">(</span><span class="s2">"Response was served by "</span> <span class="o">+</span> <span class="n">std</span><span class="o">.</span><span class="n">fileread</span><span class="p">(</span><span class="s2">"/etc/hostname"</span><span class="p">));</span> </pre></div> </div> <p>Consider that the entire contents of the file appear in the string that is returned, including newlines that may result in invalid headers if <a class="reference internal" href="#std-fileread">std.fileread()</a> is used to form a header. In that case, you may need to modify the string, for example with <code class="docutils literal notranslate"><span class="pre">regsub()</span></code> (see <a class="reference internal" href="vcl.html#vcl-7"><span class="std std-ref">VCL</span></a>):</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">beresp</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">served</span><span class="o">-</span><span class="n">by</span> <span class="o">=</span> <span class="n">regsub</span><span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">fileread</span><span class="p">(</span><span class="s2">"/etc/hostname"</span><span class="p">),</span> <span class="s2">"\R$"</span><span class="p">,</span> <span class="s2">""</span><span class="p">);</span> </pre></div> </div> </section> <section id="blob-blobread-string"> <span id="std-blobread"></span><h3>BLOB blobread(STRING)<a class="headerlink" href="#blob-blobread-string" title="Link to this heading">¶</a></h3> <p>Reads any file and returns a blob with the content.</p> <p>The entire file is cached on the first call, and subsequent calls will return this cached contents, even if the file has changed in the meantime.</p> </section> <section id="bool-file-exists-string-path"> <span id="std-file-exists"></span><h3>BOOL file_exists(STRING path)<a class="headerlink" href="#bool-file-exists-string-path" title="Link to this heading">¶</a></h3> <p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if path or the file pointed to by path exists, <code class="docutils literal notranslate"><span class="pre">false</span></code> otherwise.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">file_exists</span><span class="p">(</span><span class="s2">"/etc/return_503"</span><span class="p">))</span> <span class="p">{</span> <span class="k">return</span> <span class="p">(</span><span class="n">synth</span><span class="p">(</span><span class="mi">503</span><span class="p">,</span> <span class="s2">"Varnish is in maintenance"</span><span class="p">));</span> <span class="p">}</span> </pre></div> </div> </section> </section> <section id="type-inspection-functions"> <h2>Type Inspection functions<a class="headerlink" href="#type-inspection-functions" title="Link to this heading">¶</a></h2> <section id="bool-healthy-backend-be"> <span id="std-healthy"></span><h3>BOOL healthy(BACKEND be)<a class="headerlink" href="#bool-healthy-backend-be" title="Link to this heading">¶</a></h3> <p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if the backend <em>be</em> is healthy.</p> </section> <section id="int-port-ip-ip"> <span id="std-port"></span><h3>INT port(IP ip)<a class="headerlink" href="#int-port-ip-ip" title="Link to this heading">¶</a></h3> <p>Returns the port number of the IP address <em>ip</em>. Always returns <code class="docutils literal notranslate"><span class="pre">0</span></code> for a <code class="docutils literal notranslate"><span class="pre">*.ip</span></code> variable when the address is a Unix domain socket.</p> </section> </section> <section id="type-conversion-functions"> <h2>Type Conversion functions<a class="headerlink" href="#type-conversion-functions" title="Link to this heading">¶</a></h2> <p>These functions all have the same form:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">TYPE</span> <span class="nb">type</span><span class="p">([</span><span class="n">arguments</span><span class="p">],</span> <span class="p">[</span><span class="n">fallback</span> <span class="n">TYPE</span><span class="p">])</span> </pre></div> </div> <p>Precisely one of the <em>arguments</em> must be provided (besides the optional <em>fallback</em>), and it will be converted to <em>TYPE</em>.</p> <p>If conversion fails, <em>fallback</em> will be returned and if no fallback was specified, the VCL will be failed.</p> <section id="duration-duration-string-s-duration-fallback-real-real-int-integer"> <span id="std-duration"></span><h3>DURATION duration([STRING s], [DURATION fallback], [REAL real], [INT integer])<a class="headerlink" href="#duration-duration-string-s-duration-fallback-real-real-int-integer" title="Link to this heading">¶</a></h3> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DURATION</span> <span class="n">duration</span><span class="p">(</span> <span class="p">[</span><span class="n">STRING</span> <span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="n">DURATION</span> <span class="n">fallback</span><span class="p">],</span> <span class="p">[</span><span class="n">REAL</span> <span class="n">real</span><span class="p">],</span> <span class="p">[</span><span class="n">INT</span> <span class="n">integer</span><span class="p">]</span> <span class="p">)</span> </pre></div> </div> <p>Returns a DURATION from a STRING, REAL or INT argument.</p> <p>For a STRING <em>s</em> argument, <em>s</em> must be quantified by <code class="docutils literal notranslate"><span class="pre">ms</span></code> (milliseconds), <code class="docutils literal notranslate"><span class="pre">s</span></code> (seconds), <code class="docutils literal notranslate"><span class="pre">m</span></code> (minutes), <code class="docutils literal notranslate"><span class="pre">h</span></code> (hours),``d`` (days), <code class="docutils literal notranslate"><span class="pre">w</span></code> (weeks) or <code class="docutils literal notranslate"><span class="pre">y</span></code> (years) units.</p> <p><em>real</em> and <em>integer</em> arguments are taken as seconds.</p> <p>If the conversion of an <em>s</em> argument fails, <em>fallback</em> will be returned if provided, or a VCL failure will be triggered.</p> <p>Conversions from <em>real</em> and <em>integer</em> arguments never fail.</p> <p>Only one of the <em>s</em>, <em>real</em> or <em>integer</em> arguments may be given or a VCL failure will be triggered.</p> <p>Examples:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">beresp</span><span class="o">.</span><span class="n">ttl</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">duration</span><span class="p">(</span><span class="s2">"1w"</span><span class="p">,</span> <span class="mi">3600</span><span class="n">s</span><span class="p">);</span> <span class="nb">set</span> <span class="n">beresp</span><span class="o">.</span><span class="n">ttl</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">duration</span><span class="p">(</span><span class="n">real</span><span class="o">=</span><span class="mf">1.5</span><span class="p">);</span> <span class="nb">set</span> <span class="n">beresp</span><span class="o">.</span><span class="n">ttl</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">duration</span><span class="p">(</span><span class="n">integer</span><span class="o">=</span><span class="mi">10</span><span class="p">);</span> </pre></div> </div> </section> <section id="bytes-bytes-string-s-bytes-fallback-real-real-int-integer"> <span id="std-bytes"></span><h3>BYTES bytes([STRING s], [BYTES fallback], [REAL real], [INT integer])<a class="headerlink" href="#bytes-bytes-string-s-bytes-fallback-real-real-int-integer" title="Link to this heading">¶</a></h3> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">BYTES</span> <span class="nb">bytes</span><span class="p">(</span> <span class="p">[</span><span class="n">STRING</span> <span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="n">BYTES</span> <span class="n">fallback</span><span class="p">],</span> <span class="p">[</span><span class="n">REAL</span> <span class="n">real</span><span class="p">],</span> <span class="p">[</span><span class="n">INT</span> <span class="n">integer</span><span class="p">]</span> <span class="p">)</span> </pre></div> </div> <p>Returns BYTES from a STRING, REAL or INT argument.</p> <p>A STRING <em>s</em> argument can be quantified with a multiplier (<code class="docutils literal notranslate"><span class="pre">k</span></code> (kilo), <code class="docutils literal notranslate"><span class="pre">m</span></code> (mega), <code class="docutils literal notranslate"><span class="pre">g</span></code> (giga), <code class="docutils literal notranslate"><span class="pre">t</span></code> (tera) or <code class="docutils literal notranslate"><span class="pre">p</span></code> (peta)).</p> <p><em>real</em> and <em>integer</em> arguments are taken as bytes.</p> <p>If the conversion of an <em>s</em> argument fails, <em>fallback</em> will be returned if provided, or a VCL failure will be triggered.</p> <p>Other conversions may fail if the argument can not be represented, because it is negative, too small or too large. Again, <em>fallback</em> will be returned if provided, or a VCL failure will be triggered.</p> <p><em>real</em> arguments will be rounded down.</p> <p>Only one of the <em>s</em>, <em>real</em> or <em>integer</em> arguments may be given or a VCL failure will be triggered.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">cache_req_body</span><span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">bytes</span><span class="p">(</span><span class="n">something</span><span class="o">.</span><span class="n">somewhere</span><span class="p">,</span> <span class="mi">10</span><span class="n">K</span><span class="p">));</span> <span class="n">std</span><span class="o">.</span><span class="n">cache_req_body</span><span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">bytes</span><span class="p">(</span><span class="n">integer</span><span class="o">=</span><span class="mi">10</span><span class="o">*</span><span class="mi">1024</span><span class="p">));</span> <span class="n">std</span><span class="o">.</span><span class="n">cache_req_body</span><span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">bytes</span><span class="p">(</span><span class="n">real</span><span class="o">=</span><span class="mf">10.0</span><span class="o">*</span><span class="mi">1024</span><span class="p">));</span> </pre></div> </div> </section> <section id="int-integer-string-s-int-fallback-bool-bool-bytes-bytes-duration-duration-real-real-time-time"> <span id="std-integer"></span><h3>INT integer([STRING s], [INT fallback], [BOOL bool], [BYTES bytes], [DURATION duration], [REAL real], [TIME time])<a class="headerlink" href="#int-integer-string-s-int-fallback-bool-bool-bytes-bytes-duration-duration-real-real-time-time" title="Link to this heading">¶</a></h3> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">INT</span> <span class="n">integer</span><span class="p">(</span> <span class="p">[</span><span class="n">STRING</span> <span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="n">INT</span> <span class="n">fallback</span><span class="p">],</span> <span class="p">[</span><span class="n">BOOL</span> <span class="nb">bool</span><span class="p">],</span> <span class="p">[</span><span class="n">BYTES</span> <span class="nb">bytes</span><span class="p">],</span> <span class="p">[</span><span class="n">DURATION</span> <span class="n">duration</span><span class="p">],</span> <span class="p">[</span><span class="n">REAL</span> <span class="n">real</span><span class="p">],</span> <span class="p">[</span><span class="n">TIME</span> <span class="n">time</span><span class="p">]</span> <span class="p">)</span> </pre></div> </div> <p>Returns an INT from a STRING, BOOL or other quantity.</p> <p>If the conversion of an <em>s</em> argument fails, <em>fallback</em> will be returned if provided, or a VCL failure will be triggered.</p> <p>A <em>bool</em> argument will be returned as 0 for <code class="docutils literal notranslate"><span class="pre">false</span></code> and 1 for <code class="docutils literal notranslate"><span class="pre">true</span></code>. This conversion will never fail.</p> <p>For a <em>bytes</em> argument, the number of bytes will be returned. This conversion will never fail.</p> <p>A <em>duration</em> argument will be rounded down to the number of seconds and returned.</p> <p>A <em>real</em> argument will be rounded down and returned.</p> <p>For a <em>time</em> argument, the number of seconds since the UNIX epoch (1970-01-01 00:00:00 UTC) will be returned.</p> <p><em>duration</em>, <em>real</em> and <em>time</em> conversions may fail if the argument can not be represented because it is too small or too large. If so, <em>fallback</em> will be returned if provided, or a VCL failure will be triggered.</p> <p>Only one of the <em>s</em>, <em>bool</em>, <em>bytes</em>, <em>duration</em>, <em>real</em> or <em>time</em> arguments may be given or a VCL failure will be triggered.</p> <p>Examples:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">integer</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">foo</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">></span> <span class="mi">5</span><span class="p">)</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> <span class="nb">set</span> <span class="n">resp</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">answer</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">integer</span><span class="p">(</span><span class="n">real</span><span class="o">=</span><span class="mf">126.42</span><span class="o">/</span><span class="mi">3</span><span class="p">);</span> </pre></div> </div> </section> <section id="ip-ip-string-s-ip-fallback-bool-resolve-1-string-p"> <span id="std-ip"></span><h3>IP ip(STRING s, [IP fallback], BOOL resolve=1, [STRING p])<a class="headerlink" href="#ip-ip-string-s-ip-fallback-bool-resolve-1-string-p" title="Link to this heading">¶</a></h3> <p>Converts the string <em>s</em> to the first IP number returned by the system library function <cite>getaddrinfo(3)</cite>. If conversion fails, <em>fallback</em> will be returned or VCL failure will happen.</p> <p>The IP address includes a port number that can be found with <code class="docutils literal notranslate"><span class="pre">std.port()</span></code> that defaults to 80. The default port can be set to a different value with the <em>p</em> argument. It will be overridden if <em>s</em> contains both an IP address and a port number or service name.</p> <p>When <em>s</em> contains both, the syntax is either <code class="docutils literal notranslate"><span class="pre">address:port</span></code> or <code class="docutils literal notranslate"><span class="pre">address</span> <span class="pre">port</span></code>. If the address is a numerical IPv6 address it must be enclosed between brackets, for example <code class="docutils literal notranslate"><span class="pre">[::1]</span> <span class="pre">80</span></code> or <code class="docutils literal notranslate"><span class="pre">[::1]:http</span></code>. The <em>fallback</em> may also contain both an address and a port, but its default port is always 80.</p> <p>If <em>resolve</em> is false, <cite>getaddrinfo(3)</cite> is called using <code class="docutils literal notranslate"><span class="pre">AI_NUMERICHOST</span></code> and <code class="docutils literal notranslate"><span class="pre">AI_NUMERICSERV</span></code> to avoid network lookups depending on the system’s <cite>getaddrinfo(3)</cite> or nsswitch configuration. This makes “numerical” IP strings and services cheaper to convert.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">ip</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">X</span><span class="o">-</span><span class="n">forwarded</span><span class="o">-</span><span class="k">for</span><span class="p">,</span> <span class="s2">"0.0.0.0"</span><span class="p">)</span> <span class="o">~</span> <span class="n">my_acl</span><span class="p">)</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> </pre></div> </div> </section> <section id="real-real-string-s-real-fallback-int-integer-bool-bool-bytes-bytes-duration-duration-time-time"> <span id="std-real"></span><h3>REAL real([STRING s], [REAL fallback], [INT integer], [BOOL bool], [BYTES bytes], [DURATION duration], [TIME time])<a class="headerlink" href="#real-real-string-s-real-fallback-int-integer-bool-bool-bytes-bytes-duration-duration-time-time" title="Link to this heading">¶</a></h3> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">REAL</span> <span class="n">real</span><span class="p">(</span> <span class="p">[</span><span class="n">STRING</span> <span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="n">REAL</span> <span class="n">fallback</span><span class="p">],</span> <span class="p">[</span><span class="n">INT</span> <span class="n">integer</span><span class="p">],</span> <span class="p">[</span><span class="n">BOOL</span> <span class="nb">bool</span><span class="p">],</span> <span class="p">[</span><span class="n">BYTES</span> <span class="nb">bytes</span><span class="p">],</span> <span class="p">[</span><span class="n">DURATION</span> <span class="n">duration</span><span class="p">],</span> <span class="p">[</span><span class="n">TIME</span> <span class="n">time</span><span class="p">]</span> <span class="p">)</span> </pre></div> </div> <p>Returns a REAL from a STRING, BOOL or other quantity.</p> <p>If the conversion of an <em>s</em> argument fails, <em>fallback</em> will be returned if provided, or a VCL failure will be triggered.</p> <p>A <em>bool</em> argument will be returned as 0.0 for <code class="docutils literal notranslate"><span class="pre">false</span></code> and 1.0 for <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p> <p>For a <em>bytes</em> argument, the number of bytes will be returned.</p> <p>For a <em>duration</em> argument, the number of seconds will be returned.</p> <p>An <em>integer</em> argument will be returned as a REAL.</p> <p>For a <em>time</em> argument, the number of seconds since the UNIX epoch (1970-01-01 00:00:00 UTC) will be returned.</p> <p>None of these conversions other than <em>s</em> will fail.</p> <p>Only one of the <em>s</em>, <em>integer</em>, <em>bool</em>, <em>bytes</em>, <em>duration</em> or <em>time</em> arguments may be given or a VCL failure will be triggered.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">foo</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">)</span> <span class="o">></span> <span class="mf">5.5</span><span class="p">)</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> </pre></div> </div> </section> <section id="time-time-string-s-time-fallback-real-real-int-integer"> <span id="std-time"></span><h3>TIME time([STRING s], [TIME fallback], [REAL real], [INT integer])<a class="headerlink" href="#time-time-string-s-time-fallback-real-real-int-integer" title="Link to this heading">¶</a></h3> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">TIME</span> <span class="n">time</span><span class="p">([</span><span class="n">STRING</span> <span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="n">TIME</span> <span class="n">fallback</span><span class="p">],</span> <span class="p">[</span><span class="n">REAL</span> <span class="n">real</span><span class="p">],</span> <span class="p">[</span><span class="n">INT</span> <span class="n">integer</span><span class="p">])</span> </pre></div> </div> <p>Returns a TIME from a STRING, REAL or INT argument.</p> <p>For a STRING <em>s</em> argument, the following formats are supported:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"Sun, 06 Nov 1994 08:49:37 GMT"</span> <span class="s2">"Sunday, 06-Nov-94 08:49:37 GMT"</span> <span class="s2">"Sun Nov 6 08:49:37 1994"</span> <span class="s2">"1994-11-06T08:49:37"</span> <span class="s2">"784111777.00"</span> <span class="s2">"784111777"</span> </pre></div> </div> <p><em>real</em> and <em>integer</em> arguments are taken as seconds since the epoch.</p> <p>If the conversion of an <em>s</em> argument fails or a negative <em>real</em> or <em>integer</em> argument is given, <em>fallback</em> will be returned if provided, or a VCL failure will be triggered.</p> <p>Examples:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">time</span><span class="p">(</span><span class="n">resp</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">last</span><span class="o">-</span><span class="n">modified</span><span class="p">,</span> <span class="n">now</span><span class="p">)</span> <span class="o"><</span> <span class="n">now</span> <span class="o">-</span> <span class="mi">1</span><span class="n">w</span><span class="p">)</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">time</span><span class="p">(</span><span class="nb">int</span><span class="o">=</span><span class="mi">2147483647</span><span class="p">)</span> <span class="o"><</span> <span class="n">now</span> <span class="o">-</span> <span class="mi">1</span><span class="n">w</span><span class="p">)</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> </pre></div> </div> </section> <section id="string-strftime-time-time-string-format"> <span id="std-strftime"></span><h3>STRING strftime(TIME time, STRING format)<a class="headerlink" href="#string-strftime-time-time-string-format" title="Link to this heading">¶</a></h3> <p>Format the <em>time</em> argument with the <em>format</em> argument using <cite>strftime(3)</cite> and return the result for the UTC (historically GMT) timezone.</p> <p>The empty string is returned if formatting fails, but may also be returned as a valid result.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">iso</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="n">now</span><span class="p">,</span> <span class="s2">"%Y%m</span><span class="si">%d</span><span class="s2">T%H%M%SZ"</span><span class="p">);</span> <span class="c1"># e.g. 20210521T175241Z</span> </pre></div> </div> </section> </section> <section id="logging-functions"> <h2>LOGGING functions<a class="headerlink" href="#logging-functions" title="Link to this heading">¶</a></h2> <section id="void-log-string-s"> <span id="std-log"></span><h3>VOID log(STRING s)<a class="headerlink" href="#void-log-string-s" title="Link to this heading">¶</a></h3> <p>Logs the string <em>s</em> to the shared memory log, using <a class="reference internal" href="vsl.html#vsl-7"><span class="std std-ref">VSL</span></a> tag <code class="docutils literal notranslate"><span class="pre">SLT_VCL_Log</span></code>.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="s2">"Something fishy is going on with the vhost "</span> <span class="o">+</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">host</span><span class="p">);</span> </pre></div> </div> </section> <section id="void-syslog-int-priority-string-s"> <span id="std-syslog"></span><h3>VOID syslog(INT priority, STRING s)<a class="headerlink" href="#void-syslog-int-priority-string-s" title="Link to this heading">¶</a></h3> <p>Logs the string <em>s</em> to syslog tagged with <em>priority</em>. <em>priority</em> is formed by ORing the facility and level values. See your system’s <code class="docutils literal notranslate"><span class="pre">syslog.h</span></code> file for possible values.</p> <p>Notice: Unlike VCL and other functions in the std vmod, this function will not fail VCL processing for workspace overflows: For an out of workspace condition, the <a class="reference internal" href="#std-syslog">std.syslog()</a> function has no effect.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">syslog</span><span class="p">(</span><span class="mi">9</span><span class="p">,</span> <span class="s2">"Something is wrong"</span><span class="p">);</span> </pre></div> </div> <p>This will send a message to syslog using <code class="docutils literal notranslate"><span class="pre">LOG_USER</span> <span class="pre">|</span> <span class="pre">LOG_ALERT</span></code>.</p> </section> <section id="void-timestamp-string-s"> <span id="std-timestamp"></span><h3>VOID timestamp(STRING s)<a class="headerlink" href="#void-timestamp-string-s" title="Link to this heading">¶</a></h3> <p>Introduces a timestamp in the log with the current time, using the string <em>s</em> as the label. This is useful to time the execution of lengthy VCL subroutines, and makes the timestamps inserted automatically by Varnish more accurate.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">timestamp</span><span class="p">(</span><span class="s2">"curl-request"</span><span class="p">);</span> </pre></div> </div> </section> </section> <section id="control-and-information-functions"> <h2>CONTROL and INFORMATION functions<a class="headerlink" href="#control-and-information-functions" title="Link to this heading">¶</a></h2> <section id="bool-syntax-real"> <span id="std-syntax"></span><h3>BOOL syntax(REAL)<a class="headerlink" href="#bool-syntax-real" title="Link to this heading">¶</a></h3> <p>Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if VCL version is at least <em>REAL</em>.</p> </section> <section id="string-getenv-string-name"> <span id="std-getenv"></span><h3>STRING getenv(STRING name)<a class="headerlink" href="#string-getenv-string-name" title="Link to this heading">¶</a></h3> <p>Return environment variable <em>name</em> or the empty string. See <cite>getenv(3)</cite>.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">My</span><span class="o">-</span><span class="n">Env</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s2">"MY_ENV"</span><span class="p">);</span> </pre></div> </div> </section> <section id="bool-cache-req-body-bytes-size"> <span id="std-cache-req-body"></span><h3>BOOL cache_req_body(BYTES size)<a class="headerlink" href="#bool-cache-req-body-bytes-size" title="Link to this heading">¶</a></h3> <p>Caches the request body if it is smaller than <em>size</em>. Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if the body was cached, <code class="docutils literal notranslate"><span class="pre">false</span></code> otherwise.</p> <p>Normally the request body can only be sent once. Caching it enables retrying backend requests with a request body, as usually the case with <code class="docutils literal notranslate"><span class="pre">POST</span></code> and <code class="docutils literal notranslate"><span class="pre">PUT</span></code>.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">std</span><span class="o">.</span><span class="n">cache_req_body</span><span class="p">(</span><span class="mi">1</span><span class="n">KB</span><span class="p">))</span> <span class="p">{</span> <span class="o">...</span> <span class="p">}</span> </pre></div> </div> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">vcl_recv</span></code>.</p> </section> <section id="void-late-100-continue-bool-late"> <span id="std-late-100-continue"></span><h3>VOID late_100_continue(BOOL late)<a class="headerlink" href="#void-late-100-continue-bool-late" title="Link to this heading">¶</a></h3> <p>Controls when varnish reacts to an <code class="docutils literal notranslate"><span class="pre">Expect:</span> <span class="pre">100-continue</span></code> client request header.</p> <p>Varnish always generates a <code class="docutils literal notranslate"><span class="pre">100</span> <span class="pre">Continue</span></code> response if requested by the client trough the <code class="docutils literal notranslate"><span class="pre">Expect:</span> <span class="pre">100-continue</span></code> header when waiting for request body data.</p> <p>But, by default, the <code class="docutils literal notranslate"><span class="pre">100</span> <span class="pre">Continue</span></code> response is already generated immediately after <code class="docutils literal notranslate"><span class="pre">vcl_recv</span></code> returns to reduce latencies under the assumption that the request body will be read eventually.</p> <p>Calling <code class="docutils literal notranslate"><span class="pre">std.late_100_continue(true)</span></code> in <code class="docutils literal notranslate"><span class="pre">vcl_recv</span></code> will cause the <code class="docutils literal notranslate"><span class="pre">100</span> <span class="pre">Continue</span></code> response to only be sent when needed. This may cause additional latencies for processing request bodies, but is the correct behavior by strict interpretation of RFC7231.</p> <p>This function has no effect outside <code class="docutils literal notranslate"><span class="pre">vcl_recv</span></code> and after calling <code class="docutils literal notranslate"><span class="pre">std.cache_req_body()</span></code> or any other function consuming the request body.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vcl_recv</span> <span class="p">{</span> <span class="n">std</span><span class="o">.</span><span class="n">late_100_continue</span><span class="p">(</span><span class="n">true</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">method</span> <span class="o">==</span> <span class="s2">"POST"</span><span class="p">)</span> <span class="p">{</span> <span class="n">std</span><span class="o">.</span><span class="n">late_100_continue</span><span class="p">(</span><span class="n">false</span><span class="p">);</span> <span class="k">return</span> <span class="p">(</span><span class="k">pass</span><span class="p">);</span> <span class="p">}</span> <span class="o">...</span> <span class="p">}</span> </pre></div> </div> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">vcl_recv</span></code>.</p> </section> <section id="void-set-ip-tos-int-tos"> <span id="std-set-ip-tos"></span><h3>VOID set_ip_tos(INT tos)<a class="headerlink" href="#void-set-ip-tos-int-tos" title="Link to this heading">¶</a></h3> <p>Sets the Differentiated Services Codepoint (DSCP) / IPv4 Type of Service (TOS) / IPv6 Traffic Class (TCLASS) byte for the current session to <em>tos</em>. Silently ignored if the listen address is a Unix domain socket.</p> <p>Please note that setting the traffic class affects all requests on the same http1.1 / http2 TCP connection and, in particular, is not removed at the end of the request.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">req</span><span class="o">.</span><span class="n">url</span> <span class="o">~</span> <span class="s2">"^/slow/"</span><span class="p">)</span> <span class="p">{</span> <span class="n">std</span><span class="o">.</span><span class="n">set_ip_tos</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span> <span class="p">}</span> </pre></div> </div> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">client</span></code>.</p> </section> <section id="void-rollback-http-h"> <span id="std-rollback"></span><h3>VOID rollback(HTTP h)<a class="headerlink" href="#void-rollback-http-h" title="Link to this heading">¶</a></h3> <p>Restores the <em>h</em> HTTP headers to their original state.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">rollback</span><span class="p">(</span><span class="n">bereq</span><span class="p">);</span> </pre></div> </div> <p>Restricted to: <code class="docutils literal notranslate"><span class="pre">backend</span></code>, <code class="docutils literal notranslate"><span class="pre">vcl_recv</span></code>, <code class="docutils literal notranslate"><span class="pre">vcl_pass</span></code>, <code class="docutils literal notranslate"><span class="pre">vcl_hash</span></code>, <code class="docutils literal notranslate"><span class="pre">vcl_purge</span></code>, <code class="docutils literal notranslate"><span class="pre">vcl_miss</span></code>, <code class="docutils literal notranslate"><span class="pre">vcl_hit</span></code>, <code class="docutils literal notranslate"><span class="pre">vcl_deliver</span></code>, <code class="docutils literal notranslate"><span class="pre">vcl_synth</span></code>.</p> </section> <section id="bool-ban-string"> <span id="std-ban"></span><h3>BOOL ban(STRING)<a class="headerlink" href="#bool-ban-string" title="Link to this heading">¶</a></h3> <p>Invalidates all objects in cache that match the given expression with the ban mechanism. Returns <code class="docutils literal notranslate"><span class="pre">true</span></code> if the ban succeeded and <code class="docutils literal notranslate"><span class="pre">false</span></code> otherwise. Error details are available via <a class="reference internal" href="#std-ban-error">std.ban_error()</a>.</p> <p>The format of <em>STRING</em> is:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o"><</span><span class="n">field</span><span class="o">></span> <span class="o"><</span><span class="n">operator</span><span class="o">></span> <span class="o"><</span><span class="n">arg</span><span class="o">></span> <span class="p">[</span><span class="o">&&</span> <span class="o"><</span><span class="n">field</span><span class="o">></span> <span class="o"><</span><span class="n">oper</span><span class="o">></span> <span class="o"><</span><span class="n">arg</span><span class="o">></span> <span class="o">...</span><span class="p">]</span> </pre></div> </div> <ul> <li><p><em><field></em>:</p> <ul> <li><p>string fields:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">req.url</span></code>: The request url</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">req.http.*</span></code>: Any request header</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">obj.status</span></code>: The cache object status</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">obj.http.*</span></code>: Any cache object header</p></li> </ul> <p><code class="docutils literal notranslate"><span class="pre">obj.status</span></code> is treated as a string despite the fact that it is actually an integer.</p> </li> <li><p>duration fields:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">obj.ttl</span></code>: Remaining ttl at the time the ban is issued</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">obj.age</span></code>: Object age at the time the ban is issued</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">obj.grace</span></code>: The grace time of the object</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">obj.keep</span></code>: The keep time of the object</p></li> </ul> </li> </ul> </li> <li><p><em><operator></em>:</p> <ul> <li><p>for all fields:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">==</span></code>: <em><field></em> and <em><arg></em> are equal</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">!=</span></code>: <em><field></em> and <em><arg></em> are unequal</p></li> </ul> <p>strings are compared case sensitively</p> </li> <li><p>for string fields:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">~</span></code>: <em><field></em> matches the regular expression <em><arg></em></p></li> <li><p><code class="docutils literal notranslate"><span class="pre">!~</span></code>:<em><field></em> does not match the regular expression <em><arg></em></p></li> </ul> </li> <li><p>for duration fields:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">></span></code>: <em><field></em> is greater than <em><arg></em></p></li> <li><p><code class="docutils literal notranslate"><span class="pre">>=</span></code>: <em><field></em> is greater than or equal to <em><arg></em></p></li> <li><p><code class="docutils literal notranslate"><span class="pre"><</span></code>: <em><field></em> is less than <em><arg></em></p></li> <li><p><code class="docutils literal notranslate"><span class="pre"><=</span></code>: <em><field></em> is less than or equal to <em><arg></em></p></li> </ul> </li> </ul> </li> <li><p><em><arg></em>:</p> <ul> <li><p>for string fields:</p> <p>Either a literal string or a regular expression. Note that <em><arg></em> does not use any of the string delimiters like <code class="docutils literal notranslate"><span class="pre">"</span></code> or <code class="docutils literal notranslate"><span class="pre">{"</span></code><em>…</em><code class="docutils literal notranslate"><span class="pre">"}</span></code> or <code class="docutils literal notranslate"><span class="pre">"""</span></code><em>…</em><code class="docutils literal notranslate"><span class="pre">"""</span></code> used elsewhere in varnish. To match against strings containing whitespace, regular expressions containing <code class="docutils literal notranslate"><span class="pre">\s</span></code> can be used.</p> </li> <li><p>for duration fields:</p> <p>A VCL duration like <code class="docutils literal notranslate"><span class="pre">10s</span></code>, <code class="docutils literal notranslate"><span class="pre">5m</span></code> or <code class="docutils literal notranslate"><span class="pre">1h</span></code>, see <a class="reference internal" href="vcl.html#vcl-7-durations"><span class="std std-ref">Durations</span></a></p> </li> </ul> </li> </ul> <p>Expressions can be chained using the <em>and</em> operator <code class="docutils literal notranslate"><span class="pre">&&</span></code>. For <em>or</em> semantics, use several bans.</p> <p>The unset <em><field></em> is not equal to any string, such that, for a non-existing header, the operators <code class="docutils literal notranslate"><span class="pre">==</span></code> and <code class="docutils literal notranslate"><span class="pre">~</span></code> always evaluate as false, while the operators <code class="docutils literal notranslate"><span class="pre">!=</span></code> and <code class="docutils literal notranslate"><span class="pre">!~</span></code> always evaluate as true, respectively, for any value of <em><arg></em>.</p> </section> <section id="string-ban-error"> <span id="std-ban-error"></span><h3>STRING ban_error()<a class="headerlink" href="#string-ban-error" title="Link to this heading">¶</a></h3> <p>Returns a textual error description of the last <a class="reference internal" href="#std-ban">std.ban()</a> call from the same task or the empty string if there either was no error or no <a class="reference internal" href="#std-ban">std.ban()</a> call.</p> </section> <section id="time-now"> <span id="std-now"></span><h3>TIME now()<a class="headerlink" href="#time-now" title="Link to this heading">¶</a></h3> <p>Returns the current time. In contrast to the <code class="docutils literal notranslate"><span class="pre">now</span></code> built-in variable, every call returns a new value.</p> </section> <section id="duration-timed-call-sub"> <span id="std-timed-call"></span><h3>DURATION timed_call(SUB)<a class="headerlink" href="#duration-timed-call-sub" title="Link to this heading">¶</a></h3> <p>Call the given SUB and return a high precision measurement of the execution time.</p> </section> </section> <section id="deprecated-functions"> <h2>DEPRECATED functions<a class="headerlink" href="#deprecated-functions" title="Link to this heading">¶</a></h2> <section id="int-real2integer-real-r-int-fallback"> <span id="std-real2integer"></span><h3>INT real2integer(REAL r, INT fallback)<a class="headerlink" href="#int-real2integer-real-r-int-fallback" title="Link to this heading">¶</a></h3> <p><strong>DEPRECATED</strong>: This function will be removed in a future version of varnish, use <a class="reference internal" href="#std-integer">std.integer()</a> with a <em>real</em> argument and the <a class="reference internal" href="#std-round">std.round()</a> function instead, for example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">integer</span><span class="p">(</span><span class="n">real</span><span class="o">=</span><span class="n">std</span><span class="o">.</span><span class="n">round</span><span class="p">(</span><span class="o">...</span><span class="p">),</span> <span class="n">fallback</span><span class="o">=...</span><span class="p">)</span> </pre></div> </div> <p>Rounds the real <em>r</em> to the nearest integer, but round halfway cases away from zero (see <cite>round(3)</cite>). If conversion fails, <em>fallback</em> will be returned.</p> <p>Examples:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">integer</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">real2integer</span><span class="p">(</span><span class="mf">1140618699.00</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span> <span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">posone</span> <span class="o">=</span> <span class="n">real2integer</span><span class="p">(</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span> <span class="c1"># = 1.0</span> <span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">negone</span> <span class="o">=</span> <span class="n">real2integer</span><span class="p">(</span><span class="o">-</span><span class="mf">0.5</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span> <span class="c1"># = -1.0</span> </pre></div> </div> </section> <section id="time-real2time-real-r-time-fallback"> <span id="std-real2time"></span><h3>TIME real2time(REAL r, TIME fallback)<a class="headerlink" href="#time-real2time-real-r-time-fallback" title="Link to this heading">¶</a></h3> <p><strong>DEPRECATED</strong>: This function will be removed in a future version of varnish, use <a class="reference internal" href="#std-time">std.time()</a> with a <em>real</em> argument and the <a class="reference internal" href="#std-round">std.round()</a> function instead, for example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">time</span><span class="p">(</span><span class="n">real</span><span class="o">=</span><span class="n">std</span><span class="o">.</span><span class="n">round</span><span class="p">(</span><span class="o">...</span><span class="p">),</span> <span class="n">fallback</span><span class="o">=...</span><span class="p">)</span> </pre></div> </div> <p>Rounds the real <em>r</em> to the nearest integer (see <a class="reference internal" href="#std-real2integer">std.real2integer()</a>) and returns the corresponding time when interpreted as a unix epoch. If conversion fails, <em>fallback</em> will be returned.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">time</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">real2time</span><span class="p">(</span><span class="mf">1140618699.00</span><span class="p">,</span> <span class="n">now</span><span class="p">);</span> </pre></div> </div> </section> <section id="int-time2integer-time-t-int-fallback"> <span id="std-time2integer"></span><h3>INT time2integer(TIME t, INT fallback)<a class="headerlink" href="#int-time2integer-time-t-int-fallback" title="Link to this heading">¶</a></h3> <p><strong>DEPRECATED</strong>: This function will be removed in a future version of varnish, use <a class="reference internal" href="#std-integer">std.integer()</a> with a <em>time</em> argument instead, for example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">integer</span><span class="p">(</span><span class="n">time</span><span class="o">=...</span><span class="p">,</span> <span class="n">fallback</span><span class="o">=...</span><span class="p">)</span> </pre></div> </div> <p>Converts the time <em>t</em> to a integer. If conversion fails, <em>fallback</em> will be returned.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">int</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">time2integer</span><span class="p">(</span><span class="n">now</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span> </pre></div> </div> </section> <section id="real-time2real-time-t-real-fallback"> <span id="std-time2real"></span><h3>REAL time2real(TIME t, REAL fallback)<a class="headerlink" href="#real-time2real-time-t-real-fallback" title="Link to this heading">¶</a></h3> <p><strong>DEPRECATED</strong>: This function will be removed in a future version of varnish, use <a class="reference internal" href="#std-real">std.real()</a> with a <em>time</em> argument instead, for example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">time</span><span class="o">=...</span><span class="p">,</span> <span class="n">fallback</span><span class="o">=...</span><span class="p">)</span> </pre></div> </div> <p>Converts the time <em>t</em> to a real. If conversion fails, <em>fallback</em> will be returned.</p> <p>Example:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nb">set</span> <span class="n">req</span><span class="o">.</span><span class="n">http</span><span class="o">.</span><span class="n">real</span> <span class="o">=</span> <span class="n">std</span><span class="o">.</span><span class="n">time2real</span><span class="p">(</span><span class="n">now</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">);</span> </pre></div> </div> </section> </section> <section id="see-also"> <h2>SEE ALSO<a class="headerlink" href="#see-also" title="Link to this heading">¶</a></h2> <ul class="simple"> <li><p><a class="reference internal" href="varnishd.html#varnishd-1"><span class="std std-ref">varnishd</span></a></p></li> <li><p><a class="reference internal" href="vsl.html#vsl-7"><span class="std std-ref">VSL</span></a></p></li> <li><p><cite>fnmatch(3)</cite></p></li> <li><p><cite>strftime(3)</cite></p></li> </ul> </section> <section id="copyright"> <h2>COPYRIGHT<a class="headerlink" href="#copyright" title="Link to this heading">¶</a></h2> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>Copyright (c) 2010-2017 Varnish Software AS All rights reserved. Author: Poul-Henning Kamp <phk@FreeBSD.org> SPDX-License-Identifier: BSD-2-Clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </pre></div> </div> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <div> <h3><a href="../index.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">VMOD std - Varnish Standard Module</a></li> </ul> </div> <div> <h4>Previous topic</h4> <p class="topless"><a href="vmod_purge.html" title="previous chapter">VMOD purge - Varnish Purge Module</a></p> </div> <div> <h4>Next topic</h4> <p class="topless"><a href="vmod_unix.html" title="next chapter">VMOD unix - Utilities for Unix domain sockets</a></p> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/reference/vmod_std.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>document.getElementById('searchbox').style.display = "block"</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="vmod_unix.html" title="VMOD unix - Utilities for Unix domain sockets" >next</a> |</li> <li class="right" > <a href="vmod_purge.html" title="VMOD purge - Varnish Purge Module" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 7.5.0 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >The Varnish Reference Manual</a> »</li> <li class="nav-item nav-item-this"><a href="">VMOD std - Varnish Standard Module</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2010-2014, Varnish Software AS. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6. </div> </body> </html>