The "Vary: Accept-Encoding" header is sent. If the client allows encoding,
Content-Encoding and Content-Length are added.
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.
getAcceptedEncoding()
public static method
If no Accept-Encoding header is set, or the browser is IE before v6 SP2,
this will return ('', ''), the "identity" encoding.
A syntax-aware scan is done of the Accept-Encoding, so the method must
be non 0. The methods are favored in order of gzip, deflate, then
compress. Deflate is always smallest and generally faster, but is
rarely sent by servers, so client support could be buggier.
public static getAcceptedEncoding ( boolean $allowCompress = true, boolean $allowDeflate = true ) : array |
$allowCompress |
boolean |
allow the older compress encoding |
$allowDeflate |
boolean |
allow the more recent deflate encoding |
return |
array |
two values, 1st is the actual encoding method, 2nd is the
alias of that method to use in the Content-Encoding header (some browsers
call gzip "x-gzip" etc.) |
getContent()
public method
Call after encode() for encoded content.
$_content protected_oe property
$encodeToIe6 public_oe static_oe property
If you have many IE6 users and the bandwidth savings is worth troubling
some of them, set this to true.
By default, encoding is only offered to IE7+. When this is true,
getAcceptedEncoding() will return an encoding for IE6 if its user agent
string contains "SV1". This has been documented in many places as "safe",
but there seem to be remaining, intermittent encoding bugs in patched
IE6 on the wild web.
public static bool $encodeToIe6 |
return |
boolean |
|