mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
fix(favicon): short TTL for negative favicon cache entries
A failed favicon lookup was cached for a full week (same TTL as a success), so a transient miss (e.g. the icon not yet indexed upstream) blacklisted the domain for days. Cache negatives for 6 hours instead so the next email retries. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,13 @@ export const STATS_KEY = "stats:counters";
|
||||
/** Default TTL for a cached per-domain favicon (seconds). */
|
||||
export const ICON_TTL_SECONDS = 7 * 24 * 60 * 60; // 1 week
|
||||
|
||||
/**
|
||||
* TTL for a *negative* favicon cache entry (seconds). Kept short so a transient
|
||||
* miss (e.g. DuckDuckGo not having indexed the domain yet) self-heals within
|
||||
* hours instead of blacklisting the domain for a full 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user