Re: Compressing both php and linked css files with ob_gzhandler and htaccess
| From: | Jochem Maas | Date: | Mon, 13 Nov 2006 22:08:17 +0000 |
| Subject: | Re: Compressing both php and linked css files with ob_gzhandler and htaccess | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244574@lists.php.net to get a copy of this message | ||
Graham Anderson wrote:
> Can I compress a php file AND its referenced css files at the same time ?
>
> Currently, I am using ob_gzhandler to compress my php files only .
> Works great:)
>
>
> As I have found that you CAN NOT use ob_gz and zlib at the same time,
> how do I amend the htaccess file to use ob_gz,
er ...
>
> These files are in my CSS folder along with style.css.
> .
> .htaccess
> AddHandler application/x-httpd-php .css
> php_value auto_prepend_file gzip-css.php
> php_flag zlib.output_compression On
php_flag zlib.output_compression Off
>
no?
> gzip-css.php
> <?php
> ob_start ("ob_gzhandler");
> header("Content-type: text/css; charset: UTF-8");
> header("Cache-Control: must-revalidate");
> $offset = 60 * 60 ;
> $ExpStr = "Expires: " .
> gmdate("D, d M Y H:i:s",
> time() + $offset) . " GMT";
> header($ExpStr);
> ?>
>
> many thanks as I am learning the ins and outs of htaccess and ob_gzhandler
>
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>