
Show HN: Favicon Kit – get and embed Favicons from any web site (CDN and API) - AndreasPizsa
https://faviconkit.com/?ref=hackernews
======
MVorlm
Very interesting service! As an aside, I would love to know how someone can
afford to run "30+" edge servers for a personal SaaS project. It seems that
there will be a paid plan — but for such a niche service I wonder if it's
sustainable long term. I ask because:

1) I may be looking for static content cdn(s) in the future for a personal
project (would love recommendations!)

2) I would love to know how much money people are spending infrastructurally
(at least in the beginning) to kickstart their projects

~~~
AndreasPizsa
Good question MVorlm, thanks!

1) Static CDNs

We live in a wonderful time where CDNs are essentially free for small
projects. I use CloudFlare for almost everything, simply because it’s so easy
to set up, it gives you a free SSL endpoint, it allows you to use naked domain
names (faviconkit.com instead of www.faviconkit.com) and it just works well.
The HTML is hosted on Github Pages, which is also free.

1a) Number of edge servers

CloudFlare: 151
[https://www.cloudflare.com/network/](https://www.cloudflare.com/network/)
CloudFront: 117
[https://aws.amazon.com/cloudfront/details/](https://aws.amazon.com/cloudfront/details/)
KeyCDN: 30+ [https://www.keycdn.com/global-cdn](https://www.keycdn.com/global-
cdn) Google Cloud CDN: 90+
[https://cloud.google.com/cdn/](https://cloud.google.com/cdn/)

There are a few unique aspects of Favicon Kit specifically - the setup here is
a tiny little bit more "sophisticated", which is why I chose Key CDN for the
API itself.

2) Money spent on infrastructure (at least in the beginning)

\+ Favicon Kit used to run on Heroku until recently, so I spent a few bucks on
their hosting and CI plan. (It now runs on AWS Lambda) \+ I have a paid Github
account. \+ CloudFlare is free. \+ KeyCDN so far cost me < 100€

~~~
JohannesH
Can you say a little more about the reason you chose KeyCDN over CloudFlare or
the other providers. What features are you using?

~~~
AndreasPizsa
Sure!

Favicons change very, very rarely, so they are perfect candidates for caching;
fast extraction and caching are core features of Favicon Kit.

It was mainly the fact that Cloudflare does not cache by MIME type, but by
file extension ([https://support.cloudflare.com/hc/en-
us/articles/200172516-W...](https://support.cloudflare.com/hc/en-
us/articles/200172516-Which-file-extensions-does-Cloudflare-cache-for-static-
content-)) and/or would require page rules
([https://support.cloudflare.com/hc/en-
us/articles/11500320685...](https://support.cloudflare.com/hc/en-
us/articles/115003206852-Origin-Cache-Control)) to honor cache-control
headers. (It‘s been a while since I’ve made that decision, so I hope I'm
remembering the reasons correctly!)

KeyCDN was simple to set up and their pricing was equally simple and very
reasonable, so I ended up staying with them.

I hope this answers your question, JohannesH!

------
tzm
Or use Google:
[https://www.google.com/s2/favicons?domain=twitter.com](https://www.google.com/s2/favicons?domain=twitter.com)

~~~
spdustin
Unless that endpoint can also return other resolutions, Favicon Kit offers
more:

[https://api.faviconkit.com/twitter.com/144](https://api.faviconkit.com/twitter.com/144)
[https://api.faviconkit.com/twitter.com/16](https://api.faviconkit.com/twitter.com/16)

(Though, I will say, the URIs returned for Twitter and the image sizes don't
actually align in those cases. The first is actually 192ˣ192 pixels, and the
second is 32ˣ32 pixels. That seems odd. Maybe they should have endpoints like
domain/large, domain/medium, domain/small?)

~~~
AndreasPizsa
Great feedback, thanks.

The number after the domain is meant to be "this or the next greater size";
the actual size depends on what the source web site offers.

------
timvdalen
Really cool! One minor nitpick: A loading indicator might be nice, especially
if you're switching between domains.

The large icon can take a while to load and you can end up in an inconsistent
state where you see a mix of the old and new input.

~~~
AndreasPizsa
Thanks timvdalen, that’s good feedback - I'll add this.

------
sucrose
I'm curious what a use-case for this service would be. Why would I want to use
some company's favicon for my own website?

~~~
jwomers
Any service that stores/indexes information linked to a domain could use this
to increase the recognition factor for the customer when listing a set of
domains.

A great example is 1Password, when you type in the url of an account, it
fetches the favicon and displays it when listing your accounts, making is very
easy to quickly scroll and recognize what you want.

~~~
djsumdog
Yet it feels like this is something you could just build a library for in your
web app. I'm sure there are favicon pullers/cachers for every language out
there. I know tt-rss has one for it's RSS job.

It seems like something silly to depend on an external service for.

------
hotpockets
Pretty cool. I tried bestbuy but it gives a broken image. Not sure if you do
any scraping but bestbuy tries to prohibit it.

~~~
AndreasPizsa
Thanks for reporting this great edge case, hotpockets!

Did it actually give you a broken image? It’s supposed to return a "B" on a
grey background in such a case.

~~~
hotpockets
[https://screenshots.firefox.com/t5VF86dioR3EBaNX/faviconkit....](https://screenshots.firefox.com/t5VF86dioR3EBaNX/faviconkit.com)

~~~
AndreasPizsa
Ouch, that's a sting in my pride :) Fixing!

~~~
ldjb
I think part of the issue is that, when you return a fallback icon (the B icon
in this case), you serve it with an HTTP 404 status.

In Firefox (and possibly other browsers), the browser will not attempt to
render images returned with a 404 status. Changing it to return a 200 status
should work.

~~~
AndreasPizsa
This is fixed now. Thanks again, ldjb!

~~~
hotpockets
Can I suggest at least attempting the default favicon location, like
bestbuy.com/favicon.ico?

~~~
AndreasPizsa
It does do that, actually.

I’ll check this on the weekend; very curious what‘s causing this. Will fix &
let you know.

Thanks for your feedback and suggestion!

------
Fr0z3n
Good project. Just wanted to say that your own site doesn't have a favicon.

------
iza
Nice, I've been looking for something like this for my new tab page extension.
Will it remain free after the beta? How does it compare to
[https://github.com/mat/besticon/](https://github.com/mat/besticon/)

~~~
AndreasPizsa
Glad to hear iza, thanks for the question!

There are/have been a few free and open source alternatives out there. I built
Favicon Kit because I wanted something fast, scalable and - most of all -
reliable.

Most of the free alternatives vary in features, disappear after a while or
just become inactive (even besticon’s Heroku demo).

Favicon Kit wants to be the sustainable, reliable, solid, production-grade
service for favicons.

There will eventually be a paid plan which guarantees availability for paying
customers.

