~ubuntu-branches/debian/sid/varnish/sid

« back to all changes in this revision

Viewing changes to doc/sphinx/=build/html/_sources/installation/upgrade.txt

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-29 15:23:24 UTC
  • mfrom: (0.1.15)
  • Revision ID: package-import@ubuntu.com-20111029152324-tdtlsurrv22ysknj
Tags: 3.0.2-1
* New upstream release
* Build from upstream tarball instead of git tag
* debian/watch: more specific regular expression

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
2
Upgrading from Varnish 2.1 to 3.0
 
3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
4
 
 
5
This is a compilation of items you need to pay attention to when upgrading from Varnish 2.1 to 3.0
 
6
 
 
7
Changes to VCL
 
8
==============
 
9
 
 
10
In most cases you need to update your VCL since there has been some changes to the syntax.
 
11
 
 
12
string concatenation operator
 
13
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
14
String concatenation did not have an operator previously, but this has now been changed to ``+``.
 
15
 
 
16
no more %-escapes in strings
 
17
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
18
To simplify strings, the %-encoding has been removed. If you need non-printable characters, you need to use inline C.
 
19
 
 
20
``log`` moved to the std vmod
 
21
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
22
 
 
23
``log`` has moved to the std vmod::
 
24
 
 
25
        log "log something";
 
26
 
 
27
becomes::
 
28
 
 
29
        import std;
 
30
        std.log("log something");
 
31
 
 
32
You only need to import std once.
 
33
 
 
34
purges are now called bans
 
35
~~~~~~~~~~~~~~~~~~~~~~~~~~
 
36
 
 
37
``purge()`` and ``purge_url()`` are now respectively ``ban()`` and ``ban_url()``, so you should replace all occurences::
 
38
 
 
39
        purge("req.url = " req.url);
 
40
 
 
41
becomes::
 
42
 
 
43
        ban("req.url = " + req.url);
 
44
 
 
45
``purge`` does not take any arguments anymore, but can be used in vcl_hit or vcl_miss to purge the item from the cache, where you would reduce ttl to 0 in Varnish 2.1::
 
46
 
 
47
        sub vcl_hit {
 
48
          if (req.request == "PURGE") {
 
49
            set obj.ttl = 0s;
 
50
            error 200 "Purged.";
 
51
          }
 
52
        }
 
53
 
 
54
becomes::
 
55
 
 
56
        sub vcl_hit {
 
57
          if (req.request == "PURGE") {
 
58
            purge;
 
59
            error 200 "Purged.";
 
60
          }
 
61
        }
 
62
 
 
63
``beresp.cacheable`` is gone
 
64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
65
 
 
66
``beresp.cacheable`` is gone, and can be replaced with ``beresp.ttl > 0s``
 
67
 
 
68
returns are now done with the ``return()`` function
 
69
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
70
 
 
71
``pass``, ``pipe``, ``lookup``, ``deliver``, ``fetch``, ``hash``, ``pipe`` and ``restart`` are no longer keywords, but arguments to ``return()``, so::
 
72
 
 
73
        sub vcl_pass {
 
74
          pass;
 
75
        }
 
76
 
 
77
becomes::
 
78
 
 
79
        sub vcl_pass {
 
80
          return(pass);
 
81
        }
 
82
 
 
83
 
 
84
``req.hash`` is replaced with ``hash_data()``
 
85
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
86
 
 
87
You no longer append to the hash with ``+=``, so::
 
88
 
 
89
        set req.hash += req.url;
 
90
 
 
91
becomes::
 
92
 
 
93
        hash_data(req.url);
 
94
 
 
95
``esi`` is replaced with ``beresp.do_esi``
 
96
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
97
 
 
98
You no longer enable ESI with ``esi``, so::
 
99
 
 
100
        esi;
 
101
 
 
102
in ``vcl_fetch`` becomes::
 
103
 
 
104
        set beresp.do_esi = true;
 
105
 
 
106
``pass`` in ``vcl_fetch`` renamed to ``hit_for_pass``
 
107
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
108
 
 
109
The difference in behaviour of ``pass`` in ``vcl_recv`` and
 
110
``vcl_fetch`` confused people, so to make it clearer that they are
 
111
different, you must now do ``return(hit_for_pass)`` when doing a pass
 
112
in ``vcl_fetch``.
 
113
 
 
114
 
 
115
Changes to behaviour
 
116
====================
 
117
 
 
118
Varnish will return an error when headers are too large instead of just ignoring them. If the limits are too low, Varnish will return HTTP 413. You can change the limits by increasing http_req_hdr_len and http_req_size.
 
119
 
 
120
thread_pool_max is now per thread pool, while it was a total across all pools in 2.1. If you had this set in 2.1, you should adjust it for 3.0.