note 65386 deleted from function.ob-gzhandler by cmb
| From: | cmb@php.net | Date: | Sun, 01 Mar 2020 09:19:04 +0000 |
| Subject: | note 65386 deleted from function.ob-gzhandler by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-214262@lists.php.net to get a copy of this message | ||
Note Submitter: michael at michaelphipps dot com
----
It is also possible to use ob_gzhandler to compress css and javascript files, however some browsers
such as firefox expect content type text/css on css files.
To get around this send a content type header:
<?php
ob_start('ob_gzhandler');
?>
.... your css content ...
<?php
header("Content-Type: text/css");
header("Content-Length: ".ob_get_length());
ob_end_flush();
?>