From: Alex Rousskov Date: Wed, 11 Dec 2013 22:44:59 +0000 (+1300) Subject: Bug 3806: Caching responses with Vary header X-Git-Tag: SQUID_3_5_0_1~466 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e1f4024d217c2e7b8afb878e149037137058270;p=thirdparty%2Fsquid.git Bug 3806: Caching responses with Vary header --- diff --git a/src/MemStore.cc b/src/MemStore.cc index be88e20ed1..b86f3e00b5 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -310,6 +310,12 @@ MemStore::considerKeeping(StoreEntry &e) return; } + if (e.mem_obj->vary_headers) { + // XXX: We must store/load SerialisedMetaData to cache Vary in RAM + debugs(20, 5, "Vary not yet supported: " << e.mem_obj->vary_headers); + return; + } + keep(e); // may still fail } diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 0066f60d03..d8617d3b1b 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -487,6 +487,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result) if (strcmp(e->mem_obj->url, http->request->storeId()) != 0) { debugs(33, DBG_IMPORTANT, "clientProcessHit: URL mismatch, '" << e->mem_obj->url << "' != '" << http->request->storeId() << "'"); + http->logType = LOG_TCP_MISS; // we lack a more precise LOG_*_MISS code processMiss(); return; } @@ -518,6 +519,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result) case VARY_CANCEL: /* varyEvaluateMatch found a object loop. Process as miss */ debugs(88, DBG_IMPORTANT, "clientProcessHit: Vary object loop!"); + http->logType = LOG_TCP_MISS; // we lack a more precise LOG_*_MISS code processMiss(); return; } diff --git a/src/store.cc b/src/store.cc index 4f83302388..e1b5038d00 100644 --- a/src/store.cc +++ b/src/store.cc @@ -795,12 +795,14 @@ StoreEntry::setPublicKey() } #endif - pe->replaceHttpReply(rep); + pe->replaceHttpReply(rep, false); // no write until key is public pe->timestampsSet(); pe->makePublic(); + pe->startWriting(); // after makePublic() + pe->complete(); pe->unlock();