mirror of
https://github.com/php/presentations.git
synced 2026-04-27 17:23:43 +02:00
db0395de60
be added)
25 lines
768 B
XML
25 lines
768 B
XML
<slide title="PHP Compression">
|
|
<blurb>
|
|
PHP supports output compression via PHP's ouput buffering features and
|
|
the zlib extension.
|
|
</blurb>
|
|
<blurb>
|
|
The simplest way is to use the <code>ob_start ('ob_gzhandler')</code>
|
|
or use the configuration options <code>zlib.output_compression</code>
|
|
and <code>zlib.compression_level</code>
|
|
</blurb>
|
|
<blurb title="HTTP_Compress">
|
|
Alternatively, you can use PEAR's excellent HTTP_Compress class that will
|
|
handle everything related to HTTP_Compression for you...
|
|
</blurb>
|
|
<example fontsize="1.2em" type="php"><![CDATA[<?php
|
|
require_once 'HTTP/Compress.php';
|
|
|
|
HTTP_Compress::start ();
|
|
print "Some data\n";
|
|
print "Some more data\n";
|
|
print "Even _more_ data\n";
|
|
HTTP_Compress::output ();
|
|
?>]]>
|
|
</example>
|
|
</slide> |