YSlow: Make favicon small and cacheable


Keep favicons small and configure their caching.

How does your site score on this recommendation?

Details from Yahoo!

A favicon is an icon associated with a web page; this icon resides in the favicon.ico file in the server's root. Since the browser requests this file, it needs to be present; if it is missing, the browser returns a 404 error (see "Avoid HTTP 404 (Not Found) error").

Since favicon.ico resides in the server's root, each time the browser requests this file, the cookies for the server's root are sent. Making the favicon small and reducing the cookie size for the server's root cookies improves performance for retrieving the favicon.

Making favicon.ico cacheable avoids frequent requests for it.



YSlow recommends:

To mitigate the drawbacks of having a favicon.ico make sure:

  • It's small, preferably under 1K
  • Set Expires header with what you feel comfortable (since you cannot rename it if you decide to change it). You can probably safely set the Expires header a few months in the future. You can check the last modified date of your current favicon.ico to make an informed decision.

Read More