[master] f084558ea fetch: No conditional GET if our stale object is dying

Nils Goroll nils.goroll at uplex.de
Wed Oct 15 08:01:03 UTC 2025


commit f084558ea5e678053a37afc191a87fcac6b28128
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Sep 24 15:11:04 2025 +0200

    fetch: No conditional GET if our stale object is dying
    
    Similar to the previous commit, but we also need to re-check the condition for
    each backend request because we might have re-tried.
    
    Ref #4399

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index e6fb30cc2..da85a129f 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -388,6 +388,14 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 	oc = bo->fetch_objcore;
 	CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
 
+	// this complements the stale_oc handling in vbf_stp_mkbereq():
+	// Conditions might have changed since we made the bereq (retry)
+	if (! bo->uncacheable && bo->stale_oc != NULL &&
+	    bo->stale_oc->flags & OC_F_DYING) {
+		http_Unset(bo->bereq, H_If_Modified_Since);
+		http_Unset(bo->bereq, H_If_None_Match);
+	}
+
 	AZ(bo->storage);
 	bo->storage = bo->uncacheable ? stv_transient : STV_next();
 


More information about the varnish-commit mailing list