facebook twitter hatena line email

「Html/パフォーマンスチューニング/その他」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(画像のheightとwidthの属性を指定)
(keep-alive追加)
 
(同じ利用者による、間の7版が非表示)
行1: 行1:
==GTmatrixのSpecify image dimensionsで指摘==
+
==Specify image dimensions(GTmatrix)==
imgタグでheightとwidthの属性を追加する
+
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));
 +
}

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));
}