「Html/パフォーマンスチューニング/その他」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→GTmatrixのSpecify image dimensionsで指摘) |
|||
| 行7: | 行7: | ||
Header set Connection keep-alive | Header set Connection keep-alive | ||
</IfModule> | </IfModule> | ||
| + | |||
| + | ==HTML を縮小する== | ||
| + | 本番だけ縮小する(php--zend-smartyの例) | ||
| + | if (APPLICATION_ENV == 'testing' || APPLICATION_ENV == 'development') { | ||
| + | return $this->_smarty->fetch($name, $cache_id, $compile_id, $display); | ||
| + | } else { | ||
| + | // html圧縮対策(gtmatrix) | ||
| + | return preg_replace("!\t|\r\n|\r|\n!", "", $this->_smarty->fetch($name, $cache_id, $compile_id, $display)); | ||
| + | } | ||
2015年5月23日 (土) 19:58時点における版
GTmatrixのSpecify image dimensionsで指摘
imgタグでheightとwidthの属性を追加する(cssでなくタグにつける)
keep-alive追加
.htaccessに追加
<IfModule mod_headers.c> Header set Connection keep-alive </IfModule>
HTML を縮小する
本番だけ縮小する(php--zend-smartyの例)
if (APPLICATION_ENV == 'testing' || APPLICATION_ENV == 'development') {
return $this->_smarty->fetch($name, $cache_id, $compile_id, $display);
} else {
// html圧縮対策(gtmatrix)
return preg_replace("!\t|\r\n|\r|\n!", "", $this->_smarty->fetch($name, $cache_id, $compile_id, $display));
}
