From a353de1342140fe6535138cb063bd2aa51caf1e0 Mon Sep 17 00:00:00 2001 From: Julien Herr Date: Mon, 25 May 2026 23:22:05 +0200 Subject: [PATCH] fix(favicon): raise max icon size to 256 KB for hi-res PNGs DuckDuckGo serves hi-res PNG favicons that legitimately exceed the old 100 KB cap, causing them to be rejected and negatively cached. Co-Authored-By: Claude Opus 4.7 --- CHANGELOG.md | 6 ++++++ src/config/constants.ts | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4339080..fa3d58c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,12 @@ verbatim as the GitHub Release notes — so what you write here is what ships. ### Fixed +- Per-feed favicons no longer fail for senders whose DuckDuckGo icon is a + hi-res PNG: the maximum accepted favicon size is raised from 100 KB to 256 KB, + so legitimate large icons (~107 KB and up) are cached instead of rejected. + A domain that was already negatively cached only re-fetches once that entry's + TTL expires (and something — a new email or a favicon request — retriggers + the fetch); delete its `icon:` KV key to force an immediate refresh. - Admin dashboard table view: long feed titles no longer overflow into the Feed ID column — the title/description cell now shrinks so its text ellipsises. - RSS and Atom feeds now advertise the WebSub hub inside the feed body diff --git a/src/config/constants.ts b/src/config/constants.ts index 33ce189..2fab6c1 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -38,8 +38,13 @@ export const ICON_TTL_SECONDS = 7 * 24 * 60 * 60; // 1 week */ export const ICON_NEGATIVE_TTL_SECONDS = 6 * 60 * 60; // 6 hours -/** Maximum accepted favicon size (bytes); larger responses are rejected. */ -export const MAX_ICON_BYTES = 100 * 1024; // 100 KB +/** + * Maximum accepted favicon size (bytes); larger responses are rejected. + * DuckDuckGo serves hi-res (often 144×144) PNG favicons that legitimately + * exceed 100 KB, so the cap is generous; KV's value limit (25 MB) is the only + * hard constraint, even after base64 inflation. + */ +export const MAX_ICON_BYTES = 256 * 1024; // 256 KB /** Timeout for an outbound favicon fetch (milliseconds). */ export const ICON_FETCH_TIMEOUT_MS = 5000;