public function compress(BaseEvent $event) { $this->outputHandler->header('Content-Encoding: gzip'); if ($this->compressionType == self::COMPRESSION_GZIP) { $event->getPoc()->setOutput(\gzencode($event->getPoc()->getOutput(), 9, FORCE_GZIP)); } elseif ($this->compressionType == self::COMPRESSION_DEFLATE) { $event->getPoc()->setOutput(\gzdeflate($event->getPoc()->getOutput())); } }