From: Garri Djavadyan Date: Tue, 6 Dec 2016 23:57:47 +0000 (+1300) Subject: Bug 2258: bypassing cache but not destroying cache entry X-Git-Tag: M-staged-PR71~350 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3140dc6aff9c5b8524de4b4b95a735401cc5fb27;p=thirdparty%2Fsquid.git Bug 2258: bypassing cache but not destroying cache entry --- diff --git a/src/http.cc b/src/http.cc index f985cdc936..102b9b0b19 100644 --- a/src/http.cc +++ b/src/http.cc @@ -189,6 +189,12 @@ httpMaybeRemovePublic(StoreEntry * e, Http::StatusCode status) if (!EBIT_TEST(e->flags, KEY_PRIVATE)) return; + // If the new/incoming response cannot be stored, then it does not + // compete with the old stored response for the public key, and the + // old stored response should be left as is. + if (e->mem_obj->request && !e->mem_obj->request->flags.cachable) + return; + switch (status) { case Http::scOkay: