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.
It appears that #Composer will finally support #Forgejo and #Codeberg repositories in the next release of version 2.9. 🙌🏽
https://github.com/composer/composer/issues/12267
EC-CUBEプラグイン実装で、気をつけること
https://qiita.com/hirosaku21/items/21ca3f6a74f574007820?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items
TODAY: @MikePageDev and @ccmiller2018 are talking with Estelle Gaits (Sylius Key Contributor, SyliusCon 2025 speaker & PHP/Symfony developer)
Tune in at 8 PM GMT (timezones: https://phpa.me/alive-and-kicking-8PM) for PHP insights, open-source stories, and what's next in the Symfony ecosystem!
https://youtube.com/phparch/live
#PHP #Symfony #Sylius

A034856: a(n) = binomial(n+1, 2) + n - 1 = n*(n+3)/2 - 1
3D graph, threejs - webGL ➡️ https://decompwlj.com/3Dgraph/A034856.html
3D graph Gen, threejs animation ➡️ https://decompwlj.com/3DgraphGen/A034856.html
2D graph, first 500 terms ➡️ https://decompwlj.com/2Dgraph500terms/A034856.html
#decompwlj #math #mathematics #maths #sequence #OEIS #JavaScript #php #graph #3D #threejs #webGL #triangular #numbers #primes #PrimeNumbers #palindromes #animation #FundamentalTheoremOfArithmetic #sequences #NumberTheory #classification #integer #decomposition #number #theory #equation #graphs #sieve #fundamental #theorem #arithmetic #research

Decomposition into weight × level + jump of prime numbers:
- a new classification of primes ➡️ https://decompwlj.com/primedecomp.php
- in 3D - threejs - webGL ➡️ https://decompwlj.com/3Dgraph/Prime_numbers.html
#decompwlj #math #mathematics #maths #sequence #OEIS #JavaScript #php #graph #3D #threejs #webGL #triangular #numbers #primes #PrimeNumbers #palindromes #animation #FundamentalTheoremOfArithmetic #sequences #NumberTheory #classification #integer #decomposition #number #theory #equation #graphs #sieve #fundamental #theorem #arithmetic #research

A034838: Numbers k that are divisible by every digit of k
3D graph, threejs - webGL ➡️ https://decompwlj.com/3Dgraph/A034838.html
3D graph Gen, threejs animation ➡️ https://decompwlj.com/3DgraphGen/A034838.html
2D graph, first 500 terms ➡️ https://decompwlj.com/2Dgraph500terms/A034838.html
#decompwlj #math #mathematics #maths #sequence #OEIS #JavaScript #php #graph #3D #threejs #webGL #triangular #numbers #primes #PrimeNumbers #palindromes #animation #FundamentalTheoremOfArithmetic #sequences #NumberTheory #classification #integer #decomposition #number #theory #equation #graphs #sieve #fundamental #theorem #arithmetic #research

Optimaliseer de testefficiëntie van je team! Onze PHPUnit training leert je team hoe ze met dataproviders uitgebreide en grondige tests kunnen uitvoeren zonder dubbele code te schrijven. #PHP #PHPUnit #Efficiency

Periodic Reminder: you should spent as much time in your documentation than in your package development. I use #DDD for all my projects Documentation Driven Development 😎 . If I don't like the look of my examples in the documentation then chances are the public API is bad and needs adjustements. #PHP #OSS #library
Au #ForumPHP 2025, notre coopérateur Albin a tenté de transformer 300 téléphones en pixels pour dessiner le logo #PHP dans la salle. Une expérience participative et interactive à base de PHP, Mercure, #FrankenPHP et @clevercloud : https://les-tilleuls.coop/blog/comment-jai-failli-dessiner-le-logo-de-php-avec-300-telephones
Frameworks: Great Servants or Dangerous Masters?
🔹 Frameworks = Structure & speed
🔹 But too much reliance = Less control
Are you coding freely… or inside their walls?
🔗 LINK: https://www.phpwayoflife.com/fr/manifesto#frameworks
#PHP #Framework #Coding #SoftwareArchitectur #WebDev #Tech

I'm in a financial nightmare because I haven't found any job in months, and I've spent all the "safety net funds" I had.
If I don't find a job in the next thirty days, I'm gonna bankrupt and be forced to either leave my family to work "in offices" far from home, or accept lower-range jobs and salaries that will barely be enough to feed my kids.
As a reminder, my son has disabilities that need daily care I won't be able to give if I'm not at home.
I'm requesting help 🙏