The "Vary: Accept-Encoding" header is sent. If the client allows encoding,
Content-Encoding and Content-Length are added.
Send a CSS file, compressed if possible
$he = new HTTP_Encoder(array(
'content' => file_get_contents($cssFile)
,'type' => 'text/css'
));
$he->encode();
$he->sendAll();
Shortcut to encoding output
header('Content-Type: text/css'); // needed if not HTML
HTTP_Encoder::output($css);
Just sniff for the accepted encoding
$encoding = HTTP_Encoder::getAcceptedEncoding();
For more control over headers, use getHeaders() and getData() and send your
own output.
Note: If you don't need header mgmt, use PHP's native gzencode, gzdeflate,
and gzcompress functions for gzip, deflate, and compress-encoding
respectively.