headers->get('Content-Type'), 'text/html')) { $content = $response->getContent(); $minify = preg_replace([ '/>\s+/s', // espacios después de tags '/\s+', '<', '\\1' ], $content); $response->setContent($minify); } return $response; } }