Skip to content

perf: cache GET /api/items on the Cloudflare edge#7

Merged
phatpham9 merged 1 commit into
mainfrom
feature/cache-items-api
Jun 23, 2026
Merged

perf: cache GET /api/items on the Cloudflare edge#7
phatpham9 merged 1 commit into
mainfrom
feature/cache-items-api

Conversation

@phatpham9

Copy link
Copy Markdown
Member

Same pattern as the AI personalization ranking cache: a synthetic GET request as the Cache API key, with latestSuccessAt baked in so entries auto-invalidate on each source refresh (no manual purge), plus a 6h TTL backstop. Unlike personalize there's no LLM call to spare — the full JSON response is cached as-is, sparing D1 the same paginated read on every repeat poll of a given (source filter, query, page).

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

🔎 Cloudflare preview: https://c0a93ba5-feedreader.phatpham9.workers.dev

Uploaded from dd8d749b5790552330af0e0e1486539c5881138f. This is a Worker version preview — it shares the production D1 database, so it reads/writes real data; it does not receive cron-triggered refreshes.

Same pattern as the AI personalization ranking cache: a synthetic GET
request as the Cache API key, with latestSuccessAt baked in so entries
auto-invalidate on each source refresh (no manual purge), plus a 6h
TTL backstop. Unlike personalize there's no LLM call to spare — the
full JSON response is cached as-is, sparing D1 the same paginated read
on every repeat poll of a given (source filter, query, page).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@phatpham9 phatpham9 force-pushed the feature/cache-items-api branch from 6b56756 to 0638252 Compare June 23, 2026 12:45
@phatpham9 phatpham9 merged commit d3ea0ee into main Jun 23, 2026
2 checks passed
@phatpham9 phatpham9 deleted the feature/cache-items-api branch June 23, 2026 12:46
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