「Html/パフォーマンスチューニング/その他」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→GTmatrixのSpecify image dimensionsで指摘) |
(→keep-alive追加) |
||
| (同じ利用者による、間の1版が非表示) | |||
| 行2: | 行2: | ||
imgタグでheightとwidthの属性を追加する(cssでなくタグにつける) | imgタグでheightとwidthの属性を追加する(cssでなくタグにつける) | ||
| − | == | + | ==Enable Keep-Alive(GtMatrix)== |
| − | . | + | keep-alive追加 |
| + | *.htaccess | ||
<IfModule mod_headers.c> | <IfModule mod_headers.c> | ||
Header set Connection keep-alive | Header set Connection keep-alive | ||
</IfModule> | </IfModule> | ||
| − | ==HTML を縮小する== | + | ==HTML を縮小する(PageSpeed)== |
本番だけ縮小する(php--zend-smartyの例) | 本番だけ縮小する(php--zend-smartyの例) | ||
if (APPLICATION_ENV == 'testing' || APPLICATION_ENV == 'development') { | if (APPLICATION_ENV == 'testing' || APPLICATION_ENV == 'development') { | ||
2015年5月23日 (土) 20:02時点における最新版
Specify image dimensions(GTmatrix)
imgタグでheightとwidthの属性を追加する(cssでなくタグにつける)
Enable Keep-Alive(GtMatrix)
keep-alive追加
- .htaccess
<IfModule mod_headers.c> Header set Connection keep-alive </IfModule>
HTML を縮小する(PageSpeed)
本番だけ縮小する(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));
}
