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 <[email protected]>
This commit is contained in:
1 parent
bb9fce72ff
commit
5f13126b35
4 files changed
+60
-3
No files matched your search
@@ -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