Menu

Cache Website Favicons Safely in Ruby and Audit the favicon Gem
📰

Cache Website Favicons Safely in Ruby and Audit the favicon Gem

DEV Community: ruby·Fernando Paladini·about 9 hours ago
#IHTaEIvg
#devtoruby#devto#dev#favicon#host
Long article (1844 words) — no AI summary yet.
Reading 0:00
15s threshold

Bookmark managers, RSS readers, and link-preview cards all hit the same annoying problem: websites declare icons inconsistently across /favicon.ico , <link rel="icon"> , SVG tags, and web manifests. Delegating that lookup to an external resolver is tempting, yet hotlinking third-party icon URLs directly inside <img src="..."> leaks visitor IP addresses and Referer headers, breaks when an upstream hostname changes, and triggers mixed-content blocks if the URL uses plain http:// .

paladini/favicon (published on RubyGems as favicon 0.1.1 under the MIT License) is a tiny, zero-runtime-dependency Ruby gem created to turn a target URL into a Google /s2/favicons lookup URL.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.