GetSimple Support Forum

Full Version: Compression
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

what do you think about add the following to the first line of index.php?

Code:
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();
We can do the same with css template:

- Rename default.css to default.css.php
- Add to top of this file:
Quote:<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();
header ("content-type: text/css; charset: UTF-8");
header ("cache-control: must-revalidate");
$offset = 60 * 60;
$expire = "expires: " . gmdate ("D, d M Y H:iConfused", time() + $offset) . " GMT";
header ($expire);
?>
- Modify file template.php, on line 17 to:
Quote:<link rel="stylesheet" type="text/css" href="<?php get_theme_url(); ?>/default.css.php" media="all" />
This should be possible by configuring your server to do the right thing, either by your hosting or by using a HTACCESS-file. That way you don’t have to change all your static files into PHP files and uploads (images etc.) will automatically be gzipped as well.

It would be something we could look into but I don’t think your solution is the solution.