Skip to content

feat: Add short negative caching for failed URL fetches#28

Open
roryist wants to merge 1 commit intomasterfrom
roryist/add-negative-cache
Open

feat: Add short negative caching for failed URL fetches#28
roryist wants to merge 1 commit intomasterfrom
roryist/add-negative-cache

Conversation

@roryist
Copy link

@roryist roryist commented Feb 11, 2026

Summary

Previously, failed fetches (blocked sites, timeouts, captcha pages) were never cached. This meant every request for the same blocked URL would re-hit the target site, wasting resources and potentially triggering further rate limiting.

This adds a 5-minute negative cache for empty/failed results. Successful results retain no explicit TTL (evicted by LRU as before).

How it works

  • When a URL fetch produces an empty result (no title, description, or image), it's now cached with a 5-minute TTL
  • Subsequent requests for the same URL within 5 minutes return the cached empty result immediately
  • After 5 minutes the entry expires and unfurlist retries the fetch, allowing recovery from transient failures
  • Successful results are cached without TTL as before

Context

Related to Doist/Issues#19500 — URLs pasted into Todoist no longer consistently convert to titles.

Previously, failed fetches (blocked sites, timeouts, etc.) were never
cached, causing every request for the same URL to re-hit the target
site. This wastes resources and can trigger further rate limiting.

Failed results are now cached for 5 minutes. Successful results retain
no explicit TTL (evicted by LRU as before).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roryist roryist self-assigned this Feb 11, 2026
@roryist roryist marked this pull request as ready for review February 12, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant