logo faviconCacher


What?Caches and returns the 'best possible' favicon for a specified domain name. If an icon cannot be found or has errors it returns a 1px transparent gif.
Why?Useful when you don't want a client to directly load an icon from an unknown (potentially malicious) domain.
How?Locates icon links in the DOM, confirms they are sane-sized images, locally caches and serves them.
When?Updated 2020-03-20, CHANGELOG.md
Who?Blame Lorin Halpert

Using the service

To display a domain's icon, simply request it. Eg. <img src="//microservice.ninja/?d=amazon.com" alt="Domain icon">

Requires

dDomain only. Don't add protocol, port, or anything other than a domain, as they will be stripped out.
Examples: d=amazon.com, d=aws.amazon.com

Icons are recached every 6 months, however served images have cache-control set to 1 month (2 for blanks). This will likely increase as the service becomes more popular.

Returns - one of the following response codes

200existing cached or recached icon
201previously uncached icon
501if the requested domain's icon configuration is weird and/or we haven't programmed an edge case to catch it. Serves a blank.
400nothing. badly formed request, check your input

Optional flags

iReturns a transparent 16x16 ico file instead of a 1x1 transparent GIF file when an error occurs or no icon is found.
debugNo icon is returned, only mechanism details in plain text.
fforces a cache refresh. Abuse and/or use in production will result in a service ban.

μService by microservice.ninja – 2711 icons cached