Hi,
Someone mentioned on irc that there is no to check whether the object was a
pass (or hit-for-pass) short of adding headers in a few vcl subroutines.
There is this obj.uncacheable attribute but it's only available in vcl_hit.
This doesn't make much sense. vcl_hit will only be reached on hit, not on
hit-for-pass. Oops!
This patch makes obj.uncacheable available in deliver so you can find in a
common place whether the request was a pass (or hit-for-pass) or hit.
I've removed it from vcl_hit as always true.
This patch builds upon my previous patch, btw.
Comments? OK?
diff --git a/bin/varnishtest/tests/v00025.vtc b/bin/varnishtest/tests/v00025.vtc
index 2ac4b9d..ffd622b 100644
--- a/bin/varnishtest/tests/v00025.vtc
+++ b/bin/varnishtest/tests/v00025.vtc
@@ -22,6 +22,7 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend {
set resp.http.esi = req.esi;
set resp.http.be = req.backend_hint;
set resp.http.c_id = client.identity;
+ if (obj.uncacheable) { }
}
sub vcl_backend_response {
@@ -41,7 +42,6 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend {
sub vcl_hit {
if (obj.proto) { }
if (obj.reason) { }
- if (obj.uncacheable) { }
if (obj.keep > 1m) { }
if (obj.grace < 3m) {
return (deliver);
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 4dd6288..75b1f9b 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -612,9 +605,9 @@ sp_variables = [
),
('obj.uncacheable',
'BOOL',
- ( 'hit', ),
+ ( 'deliver', ),
( ), """
- Whether the object is uncacheable (aka hit-for-pass)
+ Whether the object is uncacheable (pass or hit-for-pass).
"""
),
('resp',
_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev