[master] 0b5c383 Start work on a "What's New" section

Andreas Plesner apj at mutt.dk
Tue Dec 17 12:39:30 CET 2013


commit 0b5c383cd4cc1cbf683c0585f3a7622ad873f9ce
Author: Andreas Plesner <apj at mutt.dk>
Date:   Tue Dec 17 12:36:47 2013 +0100

    Start work on a "What's New" section

diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst
index b3f734b..3d1e28f 100644
--- a/doc/sphinx/index.rst
+++ b/doc/sphinx/index.rst
@@ -37,6 +37,7 @@ Contents:
    tutorial/index.rst
    users-guide/index.rst
    reference/index.rst
+   whats-new/index.rst
    phk/index.rst
    glossary/index.rst
 
diff --git a/doc/sphinx/whats-new/changes.rst b/doc/sphinx/whats-new/changes.rst
new file mode 100644
index 0000000..cf027c8
--- /dev/null
+++ b/doc/sphinx/whats-new/changes.rst
@@ -0,0 +1,16 @@
+.. _whatsnew_changes:
+
+Changes in Varnish 4
+====================
+
+Varnish 4 is quite an extensive update over Varnish 3, with some very big improvements to central parts of varnish.
+
+Client/backend split
+--------------------
+In the past, Varnish has fetched the content from the backend in the same
+thread as the client request. The client and backend code has now been split,
+allowing for some much requested improvements.
+This split allows varnish to refresh content in the background while serving
+stale content quickly to the client.
+
+This split has also necessitated a change of the VCL-functions, in particular functionality has moved from the old vcl_fetch method to the two new methods vcl_backend_fetch and vcl_backend_response.
diff --git a/doc/sphinx/whats-new/index.rst b/doc/sphinx/whats-new/index.rst
new file mode 100644
index 0000000..a1d1d73
--- /dev/null
+++ b/doc/sphinx/whats-new/index.rst
@@ -0,0 +1,17 @@
+.. _whats-new-index:
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+What's new for Varnish 4.0
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+This document describes the changes that have been made for Varnish 4. The
+first section will describe the overarching changes that have gone into
+Varnish, while the second section describes what changes you need to make to
+your configuration as well as any changes in behaviour that you need to take
+into consideration while upgrading.
+
+.. toctree::
+   :maxdepth: 2
+
+   changes
+   upgrading
diff --git a/doc/sphinx/whats-new/upgrading.rst b/doc/sphinx/whats-new/upgrading.rst
new file mode 100644
index 0000000..f1fcd99
--- /dev/null
+++ b/doc/sphinx/whats-new/upgrading.rst
@@ -0,0 +1,77 @@
+.. _whatsnew_upgrading:
+
+%%%%%%%%%%%%%%%%%%%%%%
+Upgrading to Varnish 4
+%%%%%%%%%%%%%%%%%%%%%%
+
+Changes to VCL
+==============
+
+Much of the VCL syntax has changed in Varnish 4. We've tried to compile a list of changes needed to upgrade here.
+
+Version statement
+~~~~~~~~~~~~~~~~~
+To make sure that people have upgraded their VCL to the current version, varnish now requires the first line of VCL to indicate the VCL version number::
+
+	vcl 4.0;
+
+vcl_fetch is now vcl_backend_response
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Directors have been moved to the vmod_directors
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Use the hash director as a client director
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Since the client director was already a special case of the hash director, it has been removed, and you should use the hash director directly::
+
+	sub vcl_init {
+        	new h = directors.hash();
+        	h.add_backend(b1, 1);
+        	h.add_backend(b2, 1);
+	}
+	
+	sub vcl_recv {
+		set req.backend = h.backend(client.ip);
+	}
+
+error() is now a return value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+You must now explicitly return an error::
+
+	return(error(999, "Response));
+
+hit_for_pass objects are created using beresp.uncacheable
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Example::
+
+	sub vcl_backend_response {
+		if(beresp.http.X-No-Cache) {
+			set beresp.uncacheable = true;
+			set beresp.ttl = 120s;
+			return(deliver);
+		}
+	}
+
+vcl_recv should return(hash) instead of lookup now
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+req.* not available in vcl_backend_response
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+req.* used to be available in vcl_fetch, but after the split of functionality, you only have bereq.* in vcl_backend_response.
+
+vcl_* reserved
+~~~~~~~~~~~~~~
+Your own subs cannot be named vcl_* anymore. That is reserved for builtin subs.
+
+req.backend.healthy replaced by std.healthy(req.backend)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Changes to parameters
+=====================
+
+linger
+~~~~~~
+
+sess_timeout
+~~~~~~~~~~~~



More information about the varnish-commit mailing list