facebook twitter hatena line email

Html/パフォーマンスチューニング/その他

提供: 初心者エンジニアの簡易メモ
移動: 案内検索

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