サーバー高速化。mob_pagespeedのインストール。その後の調整。

Google
スポンサーリンク

前回、Googleのmod_pagespeedをいれて、webサイトの表示速度が早くなったのは良かったのですが・・・。
少しトラブルが発生しました。

1:VPSサーバーの使用メモリが3Gまでいってしまう。
2:画像のhover(_on _off)で入れ替えるやつが動かない
3:DSPのタグが表示されない。

  • 1のVPSサーバーの実装メモリが4Gなので、まあ平気かなということで保留。
  • 2は調べてみると、画像のimg alt=”” src=”~”が、data:image/gif;base64,~ といった形式になっているので、ここが原因。
  • 3はBladeのタグだけ表示されません。javascriptの中がコメントアウトで記載されていたため、mod_pagespeed側でコメントは削除という認識で削除されていましました。Bladeのコメントアウトを消して、修正完了。

この形式は、data URI schemeという形式らしい。mod_pagespeedが自動で行っているもので、軽い画像にのみ適用されるとのこと。
そのため、軽い画像(小さい画像)に、data URI schemeが適用されたみたいです。

スポンサーリンク

data URI schemeを無効化するには

date URI schemeは、inline_imagesというフィルターで作成されているので、このフィルターを無効化すればOK。

ただ、このフィルターは rewrite_images というフィルターとセットなので、rewrite_images を無効化する必要があります。

pagespeed.confの# ModPagespeedDisableFilters rewrite_images の#を外して、Apacheを再起動すればOKです。

# Explicitly disables specific filters. This is useful in
# conjuction with ModPagespeedRewriteLevel. For instance, if one
# of the filters in the CoreFilters needs to be disabled for a
# site, that filter can be added to
# ModPagespeedDisableFilters. This directive contains a
# comma-separated list of filter names, and can be repeated.
#
# ModPagespeedDisableFilters rewrite_images
# Explicitly disables specific filters. This is useful in
# conjuction with ModPagespeedRewriteLevel. For instance, if one
# of the filters in the CoreFilters needs to be disabled for a
# site, that filter can be added to
# ModPagespeedDisableFilters. This directive contains a
# comma-separated list of filter names, and can be repeated.
#
 ModPagespeedDisableFilters rewrite_images

Apache再起動

$ apachectl restart

コメント

タイトルとURLをコピーしました