public function handleRequest() { $result = $this->getJSON(); // JSON is very good compressable, so use when available if (function_exists('ob_gzhandler')) { ob_start("ob_gzhandler"); } header("Content-Type: application/json; charset=utf-8"); header("Cache-Control: private, must-revalidate"); echo JSON::Encode($result); exit; }