I never gave the website favicon much thought but decided to look a bit more into it now and find it funny how Can I Use website mentions that it is a "complicated topic" in their footnotes:
I never gave the website favicon much thought but decided to look a bit more into it now and find it funny how Can I Use website mentions that it is a "complicated topic" in their footnotes:
#Development #Approaches
Adaptive SVG favicons · Favicons using the ‘prefers-color-scheme’ media query https://ilo.im/168quh
_____
#Favicon #SVG #CSS #MediaQuery #Colors #ColorScheme #LightMode #DarkMode #WebDev #Frontend
How to create a cross platform favicon for your website
#How To #Computergraphics #Favicon #GraphicsDesigning #ico
https://gtechbooster.com/how-to-create-a-cross-platform-favicon-for-your-website/?fsp_sid=421
Tracking users with favicons, even in incognito mode
https://github.com/jonasstrehle/supercookie
#HackerNews #Tracking #Users #Favicon #Incognito #Privacy #Supercookie
𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗴𝘂𝗶𝗱𝗲 𝗮𝗯𝗼𝘂𝘁 𝗳𝗮𝘃𝗶𝗰𝗼𝗻:
https://thewhale.cc/posts/complete-guide-about-favicon
Audrey Roy has written this cheat sheet favicon sizes/types on her GitHub account to help your website shine in society.
A Self-Hosted Favicon Proxy written in PHP
https://shkspr.mobi/blog/2025/10/a-self-hosted-favicon-proxy-written-in-php/
In theory, you should be able to get the base favicon of any domain by calling /favicon.ico - but the reality is somewhat more complex than that. Plenty of sites use a wide variety of semi-standardised images which are usually only discoverable from the site's HTML.
There are several services which allow you to get favicons based on a domain. But they all have their problems.
I want to show favicons next to specific links, but I don't want to expose my visitors to unnecessary tracking. How can I proxy these images so they are stored and served locally?
There are a few existing services. Some use Cloudflare workers or other cloud services, there are some local-first ones which are unmaintained. But nothing modern, self-hosted, and as easy to deploy as uploading a single PHP file.
So here's my attempt to make something which will preserve user privacy, be reasonably fast, and have moderately up-to-date icons, while remaining fast and efficient.
Table of Contents
Getting the domain
Assuming the request comes in to https://proxy.example.com/?domain=bbc.co.uk
PHP has a handy FILTER_VALIDATE_DOMAIN filter which will determine if the string is a domain.
filter_var( $domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME );Dealing with IDNs
Some domains contain non-ASCII characters - for example https://莎士比亚.org/ - not all favicon services support International Domain Names.
Using the idn_to_ascii() function, it is possible to get the Punycode domain.
$domain = idn_to_ascii("莎士比亚.org");Getting the image
Getting the structure right
I know from my work on OpenBenches that storing tens of thousands of files in a single directory can be problematic. So I'll store the retrieved favicon in: /tld/domain/subdomain/
That will make it quick to see if an icon exists. I'll save the file with a filename based on the current timestamp. That will allow me to check if an icon is out of date, and will prevent people downloading the icons directly from me.
Preventing abuse
I don't want anyone but visitors to my site to be able to use this service. So I'll add a (weak) check to see if the request came from my domain.
$referer = parse_url( $_SERVER["HTTP_REFERER"], PHP_URL_HOST );if ( $referer == "shkspr.mobi") { …}Some browsers may not send referers for privacy reasons. So they won't see the favicons. But they probably wouldn't have seen the images loaded from a 3rd party service. So I'll serve a default image.
Putting it all together
You can grab the code from my personal git service.
🆕 blog! “A Self-Hosted Favicon Proxy written in PHP”
In theory, you should be able to get the base favicon of any domain by calling /favicon.ico - but the reality is somewhat more complex than that. Plenty of sites use a wide variety of semi-standardised images which are usually only discoverable from the site's HTML.
There are several services which allow you to …
👀 Read more: https://shkspr.mobi/blog/2025/10/a-self-hosted-favicon-proxy-written-in-php/
⸻
#favicon #HowTo #HTML #php
Путешествия 🗺️ 🧳
#favicon #pixelart #tripadvisor #kayakCom #travel #trip #туризм #tourism #путешествие
Музыка! 🎧 🎵
#favicon #pixelart #discogs #musicbrainz #lastfm #audioscrobbler
We've all used the favicon trick to distinguish local/dev from the live site, right? Here's a quick tip to tell which file @11ty should save as the favicon to the output folder, based on the environment, without modifying template files — only the passthrough: https://chriskirknielsen.com/blog/conditional-favicon-with-eleventy-passthrough-copy/ #Eleventy #favicon
#SVG #favicon support landed in #Safari Technology Preview 26 🎆🎇🌠
https://caniuse.com/link-icon-svg
Google Gemini aggiorna il logo anche sull’interfaccia web
#Aggiornamento #Design #Favicon #GeminiAI #Google #GoogleGemini #Logo #Rebranding #TechNews #Web
https://www.ceotech.it/google-gemini-aggiorna-il-logo-anche-sullinterfaccia-web/
🌘 SVG favicon 實用指南
➤ 突破傳統,擁抱 SVG favicon 的深色模式優勢
✤ https://css-tricks.com/svg-favicons-in-action/
本文探討了使用 SVG 格式的 favicon 的優勢與實作方法,尤其著重於如何支援深色模式。雖然 SVG favicon 編輯不如傳統的圖像編輯器直觀,但透過在 SVG 檔案中嵌入 CSS 樣式,可以根據瀏覽器的主題偏好切換不同的 favicon 樣式。作者分享了實用技巧,例如使用 `brightness` 和 `invert` 濾鏡來調整深色模式下的 favicon 外觀,並介紹了 RealFaviconGenerator 這款方便的線上工具,能快速生成並優化適用於多種平臺的 favicon。
+ 以前總覺得 favicon 只是小事一樁,沒想到 SVG 格式竟然能帶來這麼多的可能性,尤其是深色模式支援,讓網站的細節更完整了!
+ 文章介紹的 RealFaviconGenerator 工具真的超方便,省去了很多手動編輯的
#Web 開發 #SVG #Favicon #Dark Mode