Configuring favicon with expires header in htaccess

If you're using Apache, just add a MIME-Type for the favicon in your website's .htaccess file or to Apache's mime.types file:

# Add Proper MIME-Type for Favicon
AddType image/x-icon .ico

Then, set the Expires header a few month(s) in the future:

# Enable Apache's mod_expires Module
ExpiresActive On
ExpiresByType image/x-icon "access plus 1 month"

After clearing your browser's cache and reloading the page, you should see the favicon.ico file being served with the Cache-Control header being set to a date (specified in seconds) in the future:

Content-Type image/x-icon
Cache-Control: max-age=2592000

For related information, see the YSlow documentation on Making Your favicon.ico Small and Cacheable at: http://developer.yahoo.com/performance/rules.html#favicon