headers->get('Content-Type', ''); $isBinaryFile = str_starts_with($contentType, 'image/') || str_starts_with($contentType, 'video/') || str_starts_with($contentType, 'audio/') || str_starts_with($contentType, 'application/pdf'); if (!$isBinaryFile) { $response->headers->set('Cache-Control', 'no-store, no-cache, must-revalidate'); $response->headers->set('Expires', '0'); } } return $response; } }