I have implemented Expires headers via mod_expires on my Apache server and have successfully created expires headers for most file types, however I am having trouble with the favicon.
I initially tried adding a set of instructions for the .ico files but when checking via YSlow it has no expiry set.
When this didn't work I amended it to be a GIF, however this seems to have the same issue.
Other gif's on the website have correctly set expires headers (accoridng to YSlow at least).
Can anyone shed any light on this situation?
Best Answer
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:
Then, set the Expires header a few month(s) in the future:
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:
For related information, see the YSlow documentation on Making Your favicon.ico Small and Cacheable at: http://developer.yahoo.com/performance/rules.html#favicon