src/Net/HTTP/Response/Compressor.php
public static function compressResponse( Net_HTTP_Response $response, $type = NULL, $sendLengthHeader = TRUE )
	{
		if( !$type )
			return;
		$response->setBody( self::compressString( $response->getBody(), $type ) );
		$response->addHeaderPair( 'Content-Encoding', $type, TRUE );								//  send Encoding Header
		$response->addHeaderPair( 'Vary', "Accept-Encoding", TRUE );								//  send Encoding Header
		if( $sendLengthHeader )
			$response->addHeaderPair( 'Content-Length', strlen( $response->getBody() ), TRUE );		//  send Content-Length Header
	}
public static function compressResponse( Net_HTTP_Response $response, $type = NULL, $sendLengthHeader = TRUE )
	{
		if( !$type )
			return;
		$response->setBody( self::compressString( $response->getBody(), $type ) );
		$response->addHeaderPair( 'Content-Encoding', $type, TRUE );								//  send Encoding Header
		$response->addHeaderPair( 'Vary', "Accept-Encoding", TRUE );								//  send Encoding Header
		if( $sendLengthHeader )
			$response->addHeaderPair( 'Content-Length', strlen( $response->getBody() ), TRUE );		//  send Content-Length Header
	}
public static function compressResponse ( Net_HTTP_Response $ response , $ type = NULL , $ sendLengthHeader = TRUE ) { if ( ! $ type ) return ; $ response -> setBody ( self :: compressString ( $ response -> getBody ( ) , $ type ) ) ; $ response -> addHeaderPair ( 'Content-Encoding' , $ type , TRUE ) ; //  send Encoding Header $ response -> addHeaderPair ( 'Vary' , "Accept-Encoding" , TRUE ) ; //  send Encoding Header if ( $ sendLengthHeader ) $ response -> addHeaderPair ( 'Content-Length' , strlen ( $ response -> getBody ( ) ) , TRUE ) ; //  send Content-Length Header }
Appied HTTP Compression to a Response Object.
@access		public
@param		Net_HTTP_Response	$response			Response Object
@param		string				$type				Compression type (gzip|deflate)
@param		boolean				$sendLengthHeader	Flag: add Content-Length Header
@return		void
Appied HTTP Compression to a Response Object .