Compress

Compress -- HTTP compression

Synopsis

require_once "HTTP/Compress.php";

     HTTP_Compress::start();

     /** Your output goes here */

     HTTP_Compress::output();

Description

HTTP_Compress::start

void HTTP_Compress::start ()

Start the output buffer, and make sure that implicit flush is off so that data is always buffered.

HTTP_Compress::output

void HTTP_Compress::output ([boolean compress [, boolean use_etag [, boolean send_body]]])

Output the contents of the output buffer, compressed if desired, along with any relevant headers.

The first parameter compress defines if gzip compression should be used. (Note: The browser of the user has to support gzip also). The second parameter use_etag defines wether to generate an ETag, and don't send the body if the browser has the same object cached. send_body determines wether to send the body of the request? (Might be false for HEAD requests.)