Welcome Guest, Not a member yet? Register   Sign In
Gzip in pages?
#1

[eluser]Lovecannon[/eluser]
Okay, Im using this to GZIP my pages...
Code:
function acceptsGZip(){
    $accept = str_replace(" ","",
        strtolower($this->input->server('HTTP_ACCEPT_ENCODING'))
    );
    $accept = explode(",",$accept);
    return in_array("gzip",$accept);
    }
    
    function obOutputHandler($OutputHtml){
    global $EnableGZipEncoding;
    //-- Play with HTML before output
    //-- If GZIP not supported compression is pointless.
    // If headers were sent we can not signal GZIP encoding as
    // we will mess it all up so better drop it here!
    // If you disable GZip encoding to use plain output buffering we stop here too!
    if(!acceptsGZip() || headers_sent() || !$EnableGZipEncoding) return $OutputHtml;
    //-- We signal GZIP compression and dump encoded data
  
    return gzencode($OutputHtml);
}
$this->output->set_header("Content-Encoding: gzip");
ob_start("obOutputHandler");
It works if I manual output scripts..css..html..but if I use $this->load->view, nothing is generated...can anyone give me an example of how to GZIP content sent through $this->load->view?


Messages In This Thread
Gzip in pages? - by El Forum - 12-15-2007, 11:51 PM
Gzip in pages? - by El Forum - 12-16-2007, 01:49 AM
Gzip in pages? - by El Forum - 12-16-2007, 07:50 AM
Gzip in pages? - by El Forum - 12-16-2007, 11:21 AM
Gzip in pages? - by El Forum - 12-16-2007, 11:42 AM
Gzip in pages? - by El Forum - 12-16-2007, 11:46 AM
Gzip in pages? - by El Forum - 12-16-2007, 12:36 PM
Gzip in pages? - by El Forum - 12-16-2007, 01:51 PM
Gzip in pages? - by El Forum - 12-16-2007, 03:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB