HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //proc/self/root/proc/thread-self/root/usr/share/doc/varnish-6.0.3/html/whats-new/changes-5.2.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Changes in Varnish 5.2 &#8212; Varnish version 6.0.3 documentation</title>
    <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Upgrading to Varnish 5.2" href="upgrading-5.2.html" />
    <link rel="prev" title="Upgrading to Varnish 6.0" href="upgrading-6.0.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="upgrading-5.2.html" title="Upgrading to Varnish 5.2"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="upgrading-6.0.html" title="Upgrading to Varnish 6.0"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 6.0.3 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">What’s new / Upgrading</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="changes-in-varnish-5-2">
<span id="whatsnew-changes-5-2"></span><h1>Changes in Varnish 5.2<a class="headerlink" href="#changes-in-varnish-5-2" title="Permalink to this headline">¶</a></h1>
<p>Varnish 5.2 is mostly changes under the hood so most varnish
installations will be able to upgrade with no modifications.</p>
<div class="section" id="new-vmods-in-the-standard-distribution">
<span id="whatsnew-new-vmods"></span><h2>New VMODs in the standard distribution<a class="headerlink" href="#new-vmods-in-the-standard-distribution" title="Permalink to this headline">¶</a></h2>
<p>We have added three new VMODs to the varnish project.</p>
<div class="section" id="vmod-blob">
<h3>VMOD blob<a class="headerlink" href="#vmod-blob" title="Permalink to this headline">¶</a></h3>
<p>We have added the variables <code class="docutils literal notranslate"><span class="pre">req.hash</span></code> and <code class="docutils literal notranslate"><span class="pre">bereq.hash</span></code> to VCL,
which contain the hash value computed by Varnish for the current
request, for use in cache lookup. Their data type is BLOB, which
represents opaque data of any length – the new variables contain
the raw binary hashes.</p>
<p>This is the first time that an element of standard VCL has the BLOB
type (BLOBs have only been used in third-party VMODs until now). So we
have added VMOD blob to facilitate their use. In particular, the VMOD
implements binary-to-text encodings, for example so that you can
assign the hash to a header as a base64 or hex string. It also
provides some other utilities such as getting the length of a BLOB or
testing BLOBs for equality.</p>
<p>See <a class="reference internal" href="../reference/vmod_generated.html#vmod-blob-3"><span class="std std-ref">vmod_blob</span></a>.</p>
</div>
<div class="section" id="vmod-purge">
<h3>VMOD purge<a class="headerlink" href="#vmod-purge" title="Permalink to this headline">¶</a></h3>
<p>Before the introduction of <code class="docutils literal notranslate"><span class="pre">vcl</span> <span class="pre">4.0</span></code> there used to be a <code class="docutils literal notranslate"><span class="pre">purge</span></code> function
instead of a <code class="docutils literal notranslate"><span class="pre">return(purge)</span></code> transition. This module works like old-style
VCL purges (which should be used from both <code class="docutils literal notranslate"><span class="pre">vcl_hit</span></code> and <code class="docutils literal notranslate"><span class="pre">vcl_miss</span></code>) and
provides more capabilities than regular purges, and lets you know how many
objects were affected.</p>
<p>See <a class="reference internal" href="../reference/vmod_generated.html#vmod-purge-3"><span class="std std-ref">vmod_purge</span></a>.</p>
</div>
<div class="section" id="vmod-vtc">
<h3>VMOD vtc<a class="headerlink" href="#vmod-vtc" title="Permalink to this headline">¶</a></h3>
<p>As long as we have had VMODs, we had an internal vmod called <code class="docutils literal notranslate"><span class="pre">vmod_debug</span></code>
which was used with <code class="docutils literal notranslate"><span class="pre">varnishtest</span></code> to exercise the VMOD related parts of
<code class="docutils literal notranslate"><span class="pre">varnishd</span></code>.  Over time this vmod grew other useful functions for writing
test-cases.</p>
<p>We only distribute <code class="docutils literal notranslate"><span class="pre">vmod_debug</span></code> in source releases, because it has some
pretty evil functionality, for instance <code class="docutils literal notranslate"><span class="pre">debug.panic()</span></code>.</p>
<p>We have taken the non-suicidal test-writing goodies out of
<code class="docutils literal notranslate"><span class="pre">vmod_debug</span></code> and put them into a new <code class="docutils literal notranslate"><span class="pre">vmod_vtc</span></code>, to make them
available to people using <code class="docutils literal notranslate"><span class="pre">varnishtest</span></code> to test local configurations,
VMODs etc.</p>
<p>The hottest trick in <code class="docutils literal notranslate"><span class="pre">vmod_vtc</span></code> is that VTC-barriers can be
accessed from the VCL code, but there are other conveniences like
workspace manipulations etc.</p>
<p>See <a class="reference internal" href="../reference/vmod_generated.html#vmod-vtc-3"><span class="std std-ref">vmod_vtc</span></a>.</p>
</div>
</div>
<div class="section" id="news-for-authors-of-vmods-and-varnish-api-client-applications">
<h2>News for authors of VMODs and Varnish API client applications<a class="headerlink" href="#news-for-authors-of-vmods-and-varnish-api-client-applications" title="Permalink to this headline">¶</a></h2>
<div class="section" id="abi-strict-vrt">
<span id="whatsnew-abi"></span><h3>$ABI [strict|vrt]<a class="headerlink" href="#abi-strict-vrt" title="Permalink to this headline">¶</a></h3>
<p>VMOD authors have the option of only integrating with the blessed
interface provided by <code class="docutils literal notranslate"><span class="pre">varnishd</span></code> or go deeper in the stack. As
a general rule of thumb you are considered “on your own” if your
VMOD uses more than the VRT (Varnish RunTime) and it is supposed
to be built for the exact Varnish version.</p>
<p>Varnish was already capable of checking the major/minor VRT version
a VMOD was built against, or require the exact version, but picking
one or the other depended on how Varnish was built.</p>
<p>VMOD authors can now specify whether a module complies to the VRT
and only needs to be rebuilt when breaking changes are introduced
by adding <code class="docutils literal notranslate"><span class="pre">$ABI</span> <span class="pre">vrt</span></code> to their VCC descriptor. The default value
is <code class="docutils literal notranslate"><span class="pre">$ABI</span> <span class="pre">strict</span></code> when omitted.</p>
</div>
<div class="section" id="vsm-vsc-api-changes">
<span id="whatsnew-vsm-vsc-5-2"></span><h3>VSM/VSC API changes<a class="headerlink" href="#vsm-vsc-api-changes" title="Permalink to this headline">¶</a></h3>
<p>The export of statistics counters via shared memory has been
overhauled to get rid of limitations which made sense 11 years
ago but not so much now.</p>
<p>A set of statistics counters are now fully defined in a <code class="docutils literal notranslate"><span class="pre">.vsc</span></code>
file which is processed by the <code class="docutils literal notranslate"><span class="pre">vsctool.py</span></code> script into a .c and
.h file, which is compiled into the relevant body of code.</p>
<p>This means that statistics counters are now self-describing in
shared memory, and <code class="docutils literal notranslate"><span class="pre">varnishstat</span></code> or other VSC-API using programs
no longer have a compiled in list of which counters exist or how
to handle them.</p>
<p>This paves the way for VMODs or maybe even VCL to define
custom counters, and have them show up in varnishstat and
other VSC-API based programs just like the rest of the counters.</p>
<p>The rewrite of the VSM/VSC code simplified both APIs and
made them much more robust but code calling into these APIs
will have to be updated to match.</p>
<p>The necessary changes mostly center around detecting if the
varnishd management/worker process has restarted.</p>
<p>In the new VSM-API once setup is done, VSM_Attach() latches
on to a running varnishd master process and stays there.</p>
<p>VSM_Status() updates the in-memory list of VSM segments, and
returns status information about the master and worker processes:
Are they running?  Have they been restarted?  Have VSM segments
been added/deleted?</p>
<p>Each VSM segment is now a separate piece of shared memory
and the name of the segment can be much longer.</p>
<p>Before the actual shared memory can be accessed, the
application must call VSM_Map() and when VSM_StillValid()
indicates that the segment is no longer valid, VSM_Unmap()
should be called to release the segment again.</p>
<p>All in all, this should be simpler and more robust.</p>
</div>
<div class="section" id="vrt-api-changes">
<span id="whatsnew-vrt-5-2"></span><h3>VRT API changes<a class="headerlink" href="#vrt-api-changes" title="Permalink to this headline">¶</a></h3>
<p><code class="docutils literal notranslate"><span class="pre">VRT_purge</span></code> now fails a transaction instead of panicking when used
outside of <code class="docutils literal notranslate"><span class="pre">vcl_hit</span></code> or <code class="docutils literal notranslate"><span class="pre">vcl_miss</span></code>. It also returns the number
of purged objects.</p>
</div>
<div class="section" id="added-vut-api">
<span id="whatsnew-vut-5-2"></span><h3>Added VUT API<a class="headerlink" href="#added-vut-api" title="Permalink to this headline">¶</a></h3>
<p>One way to extend Varnish is to write VSM clients, programs that tap
into the Varnish Shared Memory (VSM) usually via <code class="docutils literal notranslate"><span class="pre">libvarnishapi</span></code> or
community bindings for other languages than C. Varnish already ships
with VUTs (Varnish UTilities) that either process the Varnish Shared
Log (VSL) like <code class="docutils literal notranslate"><span class="pre">varnishlog</span></code> or <code class="docutils literal notranslate"><span class="pre">varnishncsa</span></code> or the Varnish Shared
Counters (VSC) like <code class="docutils literal notranslate"><span class="pre">varnishstat</span></code>.</p>
<p>Most of the setup for these programs is similar, and so they shared an
API that is now available outside of the Varnish source tree. The VUT
API has been cleaned up to remove assumptions made for our utilities.
It hides most of the complexity and redundancy of setting up a log
processor and helps you focus on your functionality. If you use
autotools for building, a new macro in <code class="docutils literal notranslate"><span class="pre">varnish.m4</span></code> removes some of
the boilerplate to generate part of the documentation.</p>
<p>We hope that we will see new tools that take advantage of this API to
extend Varnish in new ways, much like VMODs made it easy to add new
functionality to VCL.</p>
<p><em>eof</em></p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Changes in Varnish 5.2</a><ul>
<li><a class="reference internal" href="#new-vmods-in-the-standard-distribution">New VMODs in the standard distribution</a><ul>
<li><a class="reference internal" href="#vmod-blob">VMOD blob</a></li>
<li><a class="reference internal" href="#vmod-purge">VMOD purge</a></li>
<li><a class="reference internal" href="#vmod-vtc">VMOD vtc</a></li>
</ul>
</li>
<li><a class="reference internal" href="#news-for-authors-of-vmods-and-varnish-api-client-applications">News for authors of VMODs and Varnish API client applications</a><ul>
<li><a class="reference internal" href="#abi-strict-vrt">$ABI [strict|vrt]</a></li>
<li><a class="reference internal" href="#vsm-vsc-api-changes">VSM/VSC API changes</a></li>
<li><a class="reference internal" href="#vrt-api-changes">VRT API changes</a></li>
<li><a class="reference internal" href="#added-vut-api">Added VUT API</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="upgrading-6.0.html"
                        title="previous chapter">Upgrading to Varnish 6.0</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="upgrading-5.2.html"
                        title="next chapter">Upgrading to Varnish 5.2</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/whats-new/changes-5.2.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</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="upgrading-5.2.html" title="Upgrading to Varnish 5.2"
             >next</a> |</li>
        <li class="right" >
          <a href="upgrading-6.0.html" title="Upgrading to Varnish 6.0"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 6.0.3 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" >What’s new / Upgrading</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2010-2014, Varnish Software AS.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.6.
    </div>
  </body>
</html>