add support for gzip compression to style.php as well as adding a much higher expire date - though could be much more effective (but also error prone) due to the session id.

git-svn-id: file:///svn/phpbb/trunk@7949 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-07-26 10:08:52 +00:00
parent 074b6e127a
commit 04c3add2ee

View file

@ -126,6 +126,19 @@ if ($id && $sid)
exit;
}
// gzip_compression
if ($config['gzip_compress'])
{
if (@extension_loaded('zlib') && !headers_sent())
{
ob_start('ob_gzhandler');
}
}
// Expire time of seven days if not recached
$expire_time = 7*86400;
$recache = false;
// Re-cache stylesheet data if necessary
if ($recompile || empty($theme['theme_data']))
{
@ -156,6 +169,9 @@ if ($id && $sid)
closedir($dir);
}
}
}
header('Content-type: text/css; charset=UTF-8');
if ($recache)
{
@ -176,16 +192,15 @@ if ($id && $sid)
$cache->destroy('sql', STYLES_THEME_TABLE);
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
}
header('Pragma: no-cache');
}
else
{
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $expire_time));
}
header('Content-type: text/css');
// Parse Theme Data
$replace = array(
'{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme',
@ -260,4 +275,6 @@ if ($id && $sid)
$db->sql_close();
}
exit;
?>