[master] 090e84c Fix an oversight which disabled TTL calculation on IMS fetches.

Poul-Henning Kamp phk at FreeBSD.org
Wed Feb 5 15:28:32 CET 2014


commit 090e84c5a28397ad7e4b2ac6fbfdbb58bc712882
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 5 14:27:37 2014 +0000

    Fix an oversight which disabled TTL calculation on IMS fetches.
    
    Also make sure that objects marked uncacheable on an IMS is treated
    as such.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 9bbc6c1..fa58309 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -271,7 +271,7 @@ vbf_stp_fetchhdr(struct worker *wrk, struct busyobj *bo)
 
 	if (bo->do_esi)
 		bo->do_stream = 0;
-	if (bo->do_pass)
+	if (bo->do_pass || bo->uncacheable)
 		bo->fetch_objcore->flags |= OC_F_PASS;
 
 	assert(wrk->handling == VCL_RET_DELIVER);
diff --git a/bin/varnishd/cache/cache_rfc2616.c b/bin/varnishd/cache/cache_rfc2616.c
index dcf4c55..5334291 100644
--- a/bin/varnishd/cache/cache_rfc2616.c
+++ b/bin/varnishd/cache/cache_rfc2616.c
@@ -117,6 +117,7 @@ RFC2616_Ttl(struct busyobj *bo)
 	case 300: /* Multiple Choices */
 	case 301: /* Moved Permanently */
 	case 302: /* Moved Temporarily */
+	case 304: /* Not Modified */
 	case 307: /* Temporary Redirect */
 	case 410: /* Gone */
 	case 404: /* Not Found */
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index 5d875ed..2b1629a 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -181,6 +181,7 @@ VRT_l_beresp_uncacheable(const struct vrt_ctx *ctx, unsigned a)
 		VSLb(ctx->vsl, SLT_VCL_Error,
 		    "Ignoring attempt to reset beresp.uncacheable");
 	} else if (a) {
+		VSLb(ctx->vsl, SLT_Debug, "XXXX: UNCACHEABLE %u" , a);
 		ctx->bo->uncacheable = a;
 	}
 }



More information about the varnish-commit mailing list