allenov писал(а):Напихал в топик текста на 500 кб, ставя разные уровни сжатие, получаю одинаковый результат веса страницы. Опера показывает сколько КБ страница весит.
Так она показывает размер уже разжатой страницы. Поэтому результат всегда будет одинаковым.
Только почему-то при выключенном гзипе показывает в 9-10 больше.
##############################################################
## MOD Title: Adjust Gzip Compression Level
## MOD Author: pentapenguin < pentapenguin@bluebottle.com > (Jeremy Conley) http://www.pentapenguin.com
## MOD Description: This MOD will let you change the compression level of Gzip output on your forum.
## This is helpful if you are on a slower host. By reducing the compression level, your site may be a little faster.
## MOD Version: 1.0.0
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: 4
## admin/admin_board.php
## includes/page_tail.php
## language/lang_english/lang_admin.php
## templates/subSilver/admin/board_config_body.tpl
##
## Included Files: n/a
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## To run the required SQL updates please see this article in the phpBB.com knowledge base:
## http://www.phpbb.com/kb/article.php?article_id=264
## Or use the SQL Generator Tool available here: http://www.phpbbstyles.com/sql.php
##
## Optional step: if you have CyberAlien's eXtreme Styles MOD (http://www.phpbb.com/phpBB/viewtopic.php?t=125251),
## you can copy the file in contrib/admin/xs_adjust_gzip_compression_level.cfg to admin/xs_adjust_gzip_compression_level.cfg and you will
## be automatically notified if there's an update available when you use the "check for updates" function.
##
## This MOD is EasyMOD friendly! (http://area51.phpbb.com/phpBB/viewforum.php?sid=&f=17)
##
## For additional language and style downloads, please visit http://www.pentapenguin.com/forum/viewtopic.php?t=1440
##############################################################
## MOD History:
## 2005-11-05 - Version 1.0.0
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_level', '9');
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
if ($config_name == 'cookie_name')
{
$cookie_name = str_replace('.', '_', $new['cookie_name']);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start Gzip Compression Level MOD
$new['gzip_level'] = preg_replace("#[^0-9]#", '9', $new['gzip_level']);
// End Gzip Compression Level MOD
#
#-----[ FIND ]------------------------------------------
#
"L_ENABLE_GZIP" => $lang['Enable_gzip'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start Gzip Compression Level MOD
'L_GZIP_LEVEL' => $lang['Gzip_level'],
'L_GZIP_LEVEL_EXPLAIN' => $lang['Gzip_level_explain'],
// End Gzip Compression Level MOD
#
#-----[ FIND ]------------------------------------------
#
"GZIP_NO" => $gzip_no,
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start Gzip Compression Level MOD
'GZIP_LEVEL' => $new['gzip_level'],
// End Gzip Compression Level MOD
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------
#
$gzip_contents = gzcompress($gzip_contents, 9);
#
#-----[ IN-LINE FIND ]------------------------------------------
#
9
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
# Note: The final result should look like this: $gzip_contents = gzcompress($gzip_contents, $board_config['gzip_level']);
#
$board_config['gzip_level']
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
# Note: the full line to find on a fresh phpBB installation is: $lang['Enable_gzip'] = 'Enable GZip Compression';
#
$lang['Enable_gzip']
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start Gzip Compression Level MOD
$lang['Gzip_level'] = 'Gzip Compression Level';
$lang['Gzip_level_explain'] = 'Here you may change the compression level to a number between 0-9. 0 is equivalent to off, 1 is very low, and 9 is the maximum. 9 is recommended unless you are on a slow host.';
// End Gzip Compression Level MOD
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_ENABLE_GZIP}</td>
<td class="row2"><input type="radio" name="gzip_compress" value="1" {GZIP_YES} /> {L_YES} <input type="radio" name="gzip_compress" value="0" {GZIP_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- Start Gzip Compression Level MOD -->
<tr>
<td class="row1">{L_GZIP_LEVEL}<br /><span class="gensmall">{L_GZIP_LEVEL_EXPLAIN}</span></td>
<td class="row2"><input type="text" class="post" name="gzip_level" value="{GZIP_LEVEL}" size="1" maxlength="1" />
</tr>
<!-- End Gzip Compression Level MOD -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
вопрос: скажите, а реальный толк от использования его (и ему подобным) есть?
Я нормальный, небуйный подонок, каких миллионы (с) А. Мухин "Горбушка"
crash писал(а): меньше трафика, считается реальным толком?
ну, конечно, считается
сформулирую вопрос по-другому: чем отличается стандартная опция в админке Включить сжатие GZip от Включить сжатие GZip + Gzip Compression Level9 ?
Я нормальный, небуйный подонок, каких миллионы (с) А. Мухин "Горбушка"
По умолчанию степень сжатия 9 - самая высокая. Степень сжатия влияет на то, сколько ресурсов и времени займет процесс сжатия. Соотвественно, на загруженных форумах нужно искать компромисс.
Эксперт - это человек, который избегает мелких ошибок на пути к грандиозному провалу.
Любая более-менее сложная задача имеет несколько простых, изящных, лёгких для понимания неправильных решений