trAvis - MANAGER
Edit File: upgrading-5.0.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="Content-Type" content="text/html; charset=utf-8" /> <title>Upgrading to Varnish 5.0 — Varnish version 5.2.1 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"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '5.2.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </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="top" title="Varnish version 5.2.1 documentation" href="../index.html" /> <link rel="up" title="What's new / Upgrading" href="index.html" /> <link rel="next" title="Changes in Varnish 4.1" href="changes-4.1.html" /> <link rel="prev" title="Changes in Varnish 5.0" href="changes-5.0.html" /> </head> <body role="document"> <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="changes-4.1.html" title="Changes in Varnish 4.1" accesskey="N">next</a> |</li> <li class="right" > <a href="changes-5.0.html" title="Changes in Varnish 5.0" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 5.2.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">What's new / Upgrading</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="upgrading-to-varnish-5-0"> <span id="whatsnew-upgrading-5-0"></span><h1>Upgrading to Varnish 5.0<a class="headerlink" href="#upgrading-to-varnish-5-0" title="Permalink to this headline">¶</a></h1> <div class="section" id="changes-to-vcl"> <h2>Changes to VCL<a class="headerlink" href="#changes-to-vcl" title="Permalink to this headline">¶</a></h2> <ul> <li><p class="first">All VCL Objects should now be defined before used</p> <ul> <li><p class="first">in particular, this is now required for ACLs. The error message for ACLs being used before being defined is confusing - see PR #2021:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Name</span> <span class="o"><</span><span class="n">acl</span><span class="o">></span> <span class="ow">is</span> <span class="n">a</span> <span class="n">reserved</span> <span class="n">name</span> </pre></div> </div> </li> </ul> </li> <li><p class="first">VCL names are restricted to alphanumeric characters, dashes (-) and underscores (_). In addition, the first character should be alphabetic. That is, the name should match "[A-Za-z][A-Za-z0-9_-]*".</p> </li> <li><p class="first">Like strings, backends and integers can now be used as boolean expressions in if statements. See <code class="docutils literal"><span class="pre">vcl(7)</span></code> for details.</p> </li> <li><p class="first">Add support to perform matches in assignments, obtaining a boolean as result:</p> <div class="highlight-default"><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">foo</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">bar</span> <span class="o">~</span> <span class="s2">"bar"</span><span class="p">;</span> </pre></div> </div> </li> <li><p class="first">Returned values from functions and methods' calls can be thrown away.</p> </li> </ul> <div class="section" id="backends"> <h3>backends<a class="headerlink" href="#backends" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Added support for the PROXY protocol via <code class="docutils literal"><span class="pre">.proxy_header</span></code> attribute. Possible values are 1 and 2, corresponding to the PROXY protocol version 1 and 2, respectively.</li> </ul> </div> <div class="section" id="vcl-recv"> <h3>vcl_recv<a class="headerlink" href="#vcl-recv" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Added <code class="docutils literal"><span class="pre">return</span> <span class="pre">(vcl(label))</span></code> to switch to the VCL labelled <cite>label</cite>.</li> <li>The <code class="docutils literal"><span class="pre">rollback</span></code> function has been retired.</li> </ul> </div> <div class="section" id="vcl-hit"> <h3>vcl_hit<a class="headerlink" href="#vcl-hit" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Replace <code class="docutils literal"><span class="pre">return</span> <span class="pre">(fetch)</span></code> with <code class="docutils literal"><span class="pre">return</span> <span class="pre">(miss)</span></code>.</li> </ul> </div> <div class="section" id="vcl-backend"> <h3>vcl_backend_*<a class="headerlink" href="#vcl-backend" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Added read access to <code class="docutils literal"><span class="pre">remote.ip</span></code>, <code class="docutils literal"><span class="pre">client.ip</span></code>, <code class="docutils literal"><span class="pre">local.ip</span></code> and <code class="docutils literal"><span class="pre">server.ip</span></code>.</li> </ul> </div> <div class="section" id="vcl-backend-fetch"> <h3>vcl_backend_fetch<a class="headerlink" href="#vcl-backend-fetch" title="Permalink to this headline">¶</a></h3> <ul> <li><p class="first">Added write access to <code class="docutils literal"><span class="pre">bereq.body</span></code>, the request body. Only <code class="docutils literal"><span class="pre">unset</span></code> is supported at this time.</p> </li> <li><p class="first">We now send request bodies by default (see <a class="reference internal" href="changes-5.0.html#whatsnew-changes-5-0-reqbody"><span class="std std-ref">Request Body sent always / "cacheable POST"</span></a>). To keep the previous behaviour add the following code before any <code class="docutils literal"><span class="pre">return</span> <span class="pre">(..)</span></code> statement in this subroutine:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">bereq</span><span class="o">.</span><span class="n">method</span> <span class="o">==</span> <span class="s2">"GET"</span><span class="p">)</span> <span class="p">{</span> <span class="n">unset</span> <span class="n">bereq</span><span class="o">.</span><span class="n">body</span><span class="p">;</span> <span class="p">}</span> </pre></div> </div> </li> </ul> </div> <div class="section" id="vcl-backend-error"> <h3>vcl_backend_error<a class="headerlink" href="#vcl-backend-error" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Added write access to <code class="docutils literal"><span class="pre">beresp.body</span></code>, the response body. This may replace <code class="docutils literal"><span class="pre">synthetic()</span></code> in future releases.</li> </ul> </div> <div class="section" id="vcl-deliver"> <h3>vcl_deliver<a class="headerlink" href="#vcl-deliver" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Added read access to <code class="docutils literal"><span class="pre">obj.ttl</span></code>, <code class="docutils literal"><span class="pre">obj.age</span></code>, <code class="docutils literal"><span class="pre">obj.grace</span></code> and <code class="docutils literal"><span class="pre">obj.keep</span></code>.</li> </ul> </div> <div class="section" id="vcl-synth"> <h3>vcl_synth<a class="headerlink" href="#vcl-synth" title="Permalink to this headline">¶</a></h3> <ul class="simple"> <li>Added write access to <code class="docutils literal"><span class="pre">resp.body</span></code>, the response body. This may replace <code class="docutils literal"><span class="pre">synthetic()</span></code> in future releases.</li> </ul> </div> </div> <div class="section" id="management-interface"> <h2>Management interface<a class="headerlink" href="#management-interface" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>To disable CLI authentication use <code class="docutils literal"><span class="pre">-S</span> <span class="pre">none</span></code>.</li> <li><code class="docutils literal"><span class="pre">n_waitinglist</span></code> statistic removed.</li> </ul> </div> <div class="section" id="changes-to-parameters"> <h2>Changes to parameters<a class="headerlink" href="#changes-to-parameters" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>Added <code class="docutils literal"><span class="pre">ban_lurker_holdoff</span></code>.</li> <li>Removed <code class="docutils literal"><span class="pre">session_max</span></code>. This parameter actually had no effect since 4.0 but might come back in a future release.</li> <li><code class="docutils literal"><span class="pre">vcl_path</span></code> is now a colon-separated list of directories, replacing <code class="docutils literal"><span class="pre">vcl_dir</span></code>.</li> <li><code class="docutils literal"><span class="pre">vmod_path</span></code> is now a colon-separated list of directories, replacing <code class="docutils literal"><span class="pre">vmod_dir</span></code>.</li> </ul> </div> <div class="section" id="other-changes"> <h2>Other changes<a class="headerlink" href="#other-changes" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li><code class="docutils literal"><span class="pre">varnishstat(1)</span></code> -f option accepts a <code class="docutils literal"><span class="pre">glob(7)</span></code> pattern.</li> <li>Cache-Control and Expires headers for uncacheable requests (i.e. passes) will not be parsed. As a result, the RFC variant of the TTL VSL tag is no longer logged.</li> </ul> </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="#">Upgrading to Varnish 5.0</a><ul> <li><a class="reference internal" href="#changes-to-vcl">Changes to VCL</a><ul> <li><a class="reference internal" href="#backends">backends</a></li> <li><a class="reference internal" href="#vcl-recv">vcl_recv</a></li> <li><a class="reference internal" href="#vcl-hit">vcl_hit</a></li> <li><a class="reference internal" href="#vcl-backend">vcl_backend_*</a></li> <li><a class="reference internal" href="#vcl-backend-fetch">vcl_backend_fetch</a></li> <li><a class="reference internal" href="#vcl-backend-error">vcl_backend_error</a></li> <li><a class="reference internal" href="#vcl-deliver">vcl_deliver</a></li> <li><a class="reference internal" href="#vcl-synth">vcl_synth</a></li> </ul> </li> <li><a class="reference internal" href="#management-interface">Management interface</a></li> <li><a class="reference internal" href="#changes-to-parameters">Changes to parameters</a></li> <li><a class="reference internal" href="#other-changes">Other changes</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="changes-5.0.html" title="previous chapter">Changes in Varnish 5.0</a></p> <h4>Next topic</h4> <p class="topless"><a href="changes-4.1.html" title="next chapter">Changes in Varnish 4.1</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/whats-new/upgrading-5.0.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <div><input type="text" name="q" /></div> <div><input type="submit" value="Go" /></div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </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="changes-4.1.html" title="Changes in Varnish 4.1" >next</a> |</li> <li class="right" > <a href="changes-5.0.html" title="Changes in Varnish 5.0" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 5.2.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >What's new / Upgrading</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2010-2014, Varnish Software AS. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9. </div> </body> </html>