Skip to content

Instantly share code, notes, and snippets.

@t32k
Last active December 22, 2015 23:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t32k/6546259 to your computer and use it in GitHub Desktop.
Save t32k/6546259 to your computer and use it in GitHub Desktop.
The Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 35 best practices divided into 7 categories.

favicon.icoはキャッシュ可能かつ軽量にする

タグ: 画像

画像であるfavicon.icoはサーバーのルートにあります。たとえファビコンを用意してなくても、ブラウザはそれをリクエストし続ける弊害をもたらしますので、404 Not Foundを返すべきではありません。また同一サーバー上にあるため、クッキーはリクエストがあるたびに送られます。このファビコンはダウンロードシークエンスを妨げます。例えばIEにおいて、onloadのタイミングでなにか特別にコンポーネントをリクエストするときに、そのコンポーネントの前にファビコンがダウンロードされます。

ファビコンのデメリット最小限にするために、以下のことを確認して下さい。

  • 可能な限り、軽量にしてください。1KB以下が望ましいです。
  • 適切な期間でExpiresヘッダを設定してください(なぜならファビコンを変更しようと思ってもファイル名を変更できないため)。数ヶ月後のExpiresヘッダを設定すれば比較的安全かと思います。数値に基づいた判断をするために現在のファビコンの最終更新日時を確認することが出来ます。

ImageMagickを使うと、ファビコンを軽量にすることができます。


http://developer.yahoo.com/performance/rules.html#favicon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment