[6.0] 4297c891f doc: Mention the effect of Connection:close in beresp

Reza Naghibi reza at naghibi.com
Tue Apr 20 18:16:05 UTC 2021


commit 4297c891f258480c4c7a73e3430a2ae8529c7aae
Author: Steven <wojcikjsteven at gmail.com>
Date:   Mon Apr 12 14:18:32 2021 -0400

    doc: Mention the effect of Connection:close in beresp
    
    Original author: @dridi
    
    This commit is from ba78ebeb28105290bef56008f52bf63e58d5a894 but
    with no analogous file in 6.0, it is added to changes-6.0.rst instead of changes-trunk.rst

diff --git a/doc/sphinx/whats-new/changes-6.0.rst b/doc/sphinx/whats-new/changes-6.0.rst
index 41fd5052e..c8b28086a 100644
--- a/doc/sphinx/whats-new/changes-6.0.rst
+++ b/doc/sphinx/whats-new/changes-6.0.rst
@@ -50,6 +50,31 @@ this should make life simpler for everybody we hope.
 
 And it goes without saying that we have fixed a lot of bugs too.
 
+Changes to VCL
+==============
+
+VCL variables
+~~~~~~~~~~~~~
+
+It is now possible to manually set a ``Connection: close`` header in
+``beresp`` to signal that the backend connection shouldn't be recycled.
+This might help dealing with backends that would under certain circumstances
+have trouble managing their end of the connection, for example for certain
+kinds of resources.
+
+Care should be taken to preserve other headers listed in the connection
+header::
+
+    sub vcl_backend_response {
+        if (beresp.backend == faulty_backend) {
+            if (beresp.http.Connection) {
+                set beresp.http.Connection += ", close";
+            } else {
+                set beresp.http.Connection = "close";
+            }
+        }
+    }
+
 
 Under the hood (mostly for developers)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the varnish-commit mailing list