public function configure(Response $response, \DateTime $last_modified, $lifetime)
    {
        $request = $this->request_stack->getMasterRequest();

        if (!($request instanceof Request)) {
            return $response;
        }

        // order is important
        $this
            ->setPrivateCache($response, $request)
            ->setLastModified($response, $last_modified)
            ->setLifetime($response, $lifetime)
            ->setEtag($response);

        return $response;
    }