From 232ef236ea6a3e22de867d8a1dbda492cd1b53e4 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Sat, 14 Dec 2013 22:18:46 -0700 Subject: [PATCH] Bug 3806: Caching responses with Vary header --- src/MemStore.cc | 6 ++++++ src/client_side_reply.cc | 2 ++ src/store.cc | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) 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 77a963cf3c..0c059c4f40 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 4d6b771bab..dc56a3e1c8 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(); -- 2.47.2