Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cache my favicon

Im trying to make my favicon cacheable as yslow suggets.

My favicon is http://www.tucoaster.com/favicon.ico

For some reason, the content type of the favicon is text/plain. I'm using apache2, and in my .htaccess i have

ExpiresByType text/plain "access plus 30 days"
ExpiresByType image/x-icon "access plus 30 days"
ExpiresByType image/ico "access plus 30 days"

Note: Javascript and css headers are sent ok.

Any suggestion?

like image 205
Chux Avatar asked Oct 31 '25 06:10

Chux


1 Answers

Apache may not know the right MIME type for the ICO format.

Try adding

AddType image/x-icon .ico

before the ExpiresByType directives.

like image 135
Pekka Avatar answered Nov 01 '25 22:11

Pekka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!