Support Forums

Serving gzipped favicon.ico

For my site: arthistorian.netlify.app , I would like to gzip the favicon.ico file. If I am running my own Apache server, I know how to do that. Is there something in Netlify.toml that I can use to gzip the favicon.ico file?

Thank you!

howdy @mvenkadesan, we looked at this and it seems that for the time being, you don’t have the ability to compress a favicon. If this should change, we can update you for sure.

I know that wasn’t what you were hoping to hear, but, as favicons tend to be quite small any any case, hopefully this won’t be too impactful.



Little up on this issue, I’ve run into the same issue on WebPageTest and with a little search I found this solution : Compress your favicon with gzip • George Mandis

Maybe It would help.

Have a good day

Hi @Maxime-Asphalte,

Thank you for sharing.

The approach in the article won’t work with Netlify because it relies on Apache .htaccess files, which Netlify doesn’t do.

What you could do in Netlify is manually compress the file with GZIP and then in the _headers file set favicon.ico to have Content-Encoding: gzip. The downside of this approach (besides being manual) is that any client which doesn’t support GZIP (which is probably a bad, old client, but still) won’t be able to use the file.

1 Like

Thanks for taking the time to share this, @carlmjohnson :netlisparkles: