private function handle304Response(RequestInterface $request, ResponseInterface $response, ResponseInterface $validated, CompleteEvent $event)
 {
     // Make sure that this response has the same ETag
     if ($validated->getHeader('ETag') !== $response->getHeader('ETag')) {
         // Revalidation failed, so remove from cache and retry.
         $this->storage->delete($request);
         $event->intercept($event->getClient()->send($request));
         return;
     }
     // Replace cached headers with any of these headers from the
     // origin server that might be more up to date
     $modified = false;
     foreach (self::$replaceHeaders as $name) {
         if ($validated->hasHeader($name) && $validated->getHeader($name) != $response->getHeader($name)) {
             $modified = true;
             $response->setHeader($name, $validated->getHeader($name));
         }
     }
     // Store the updated response in cache
     if ($modified) {
         $this->storage->cache($request, $response);
     }
 }