Permalink
Browse files

Make sure we don't write back the data we just read from cache (esp s…

…ince in case of 304, this would actually remove the content..)
  • Loading branch information...
flack committed Jan 31, 2019
1 parent 90ae62f commit 09cd7e2bd9e8f07187a15b1ee19469937213de14
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/midcom/services/cache/module/content.php
@@ -223,7 +223,7 @@ private function _check_hit(Request $request)
foreach (midcom_connection::get_url('argv') as $arg) {
if (in_array($arg, ["midcom-cache-invalidate", "midcom-cache-nocache"])) {
// Don't cache these.
debug_add("X-MidCOM-cache: " . $arg . " uncached");
debug_add("uncached: $arg");
return;
}
}
@@ -263,7 +263,7 @@ private function _check_hit(Request $request)
return;
}
debug_add("X-MidCOM-meta-cache: HIT {$content_id}");
debug_add("HIT {$content_id}");
$response = new Response;
$this->apply_headers($response, $data['sent_headers']);
@@ -277,6 +277,8 @@ private function _check_hit(Request $request)
}
$response->setContent($content);
}
// disable cache writing in on_response
$this->_no_cache = true;
return $response;
}

0 comments on commit 09cd7e2

Please sign in to comment.