[5.2] 5188382 Document addition of {be}req.hash to 5.2.
PÃ¥l Hermunn Johansen
hermunn at varnish-software.com
Fri Sep 15 11:17:22 UTC 2017
commit 5188382ee591d137a579a349738e657afdd0327f
Author: Geoff Simmons <geoff at uplex.de>
Date: Wed Sep 13 12:48:16 2017 +0200
Document addition of {be}req.hash to 5.2.
diff --git a/doc/sphinx/whats-new/upgrading-5.2.rst b/doc/sphinx/whats-new/upgrading-5.2.rst
index 31d075b..8a789d1 100644
--- a/doc/sphinx/whats-new/upgrading-5.2.rst
+++ b/doc/sphinx/whats-new/upgrading-5.2.rst
@@ -40,8 +40,24 @@ XXX: headline changes ...
``req.hash`` and ``bereq.hash``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-*XXX: about {be}req.hash, mention data type BLOB, advise about*
-*:ref:`vmod_blob(3)`*
+Added ``req.hash`` and ``bereq.hash``, which contain the hash value
+computed by Varnish for cache lookup in the current transaction, to
+be used in client or backend context, respectively. Their data type
+is BLOB, and they contain the raw binary hash.
+
+You can use :ref:`vmod_blob(3)` to work with the hashes::
+
+ import blob;
+
+ sub vcl_backend_fetch {
+ # Send the transaction hash to the backend as a hex string
+ set bereq.http.Hash = blob.encode(HEX, blob=bereq.hash);
+ }
+
+ sub vcl_deliver {
+ # Send the hash in a response header as a base64 string
+ set resp.http.Hash = blob.encode(BASE64, blob=req.hash);
+ }
XXX: vcl_sub_XXX ...
~~~~~~~~~~~~~~~~~~~~
More information about the varnish-commit
mailing list