sesh / ready

Are you production ready?
ISC License
26 stars 4 forks source link

Serving `favicon.ico` with different `Content-Type` header #17

Closed Seirdy closed 7 months ago

Seirdy commented 9 months ago

A PNG file may be preferable to an ICO file if it downscales well, as it can be served at a smaller size (especially with Zopflipng or Efficient-Compression-Tool). It can also eliminate one request, assuming caching works properly: we can more easily re-use the site favicon in other places.

Serving a PNG file at /favicon.ico with a Content-Type: image/png header works in all browsers I've tried, including some obscure ones like NetSurf-GTK3. The only place it doesn't seem to work is Microsoft Bing, and I'm inclined to believe that this is an issue in Bing. Engines powered by Bing generally source favicons themselves, and they all seem to do it right; Microsoft Bing itself is alone here in getting it wrong.

Unfortunately, ready appears to fail a /favicon.ico with a Content-Type: image/png.

Test case: run ready on seirdy.one.

sesh commented 7 months ago

Hey @Seirdy, work completely got in the way of this one.

I agree, more image types should be allowed. Thanks for sharing your testing.