perf(api): convert POST RPCs to GET for CDN caching (#795)

* perf(api): convert classify-event to GET and add summarize-article cache endpoint for CDN caching

classify-event (7.9M calls/wk) was POST — bypassing all CDN caching.
Converting to GET with static cache tier (1hr) enables Cloudflare edge
caching. Degraded responses (no API key, empty title, errors) are marked
no-cache to prevent caching error states.

summarize-article has repeated headlines too large for URL params. Added
a new GetSummarizeArticleCache GET endpoint that looks up Redis by a
deterministic cache key. Client computes key via shared
buildSummaryCacheKey(), tries GET first (CDN-cacheable), falls back to
existing POST on miss. Shared module ensures client/server key parity.

* fix(types): wire missing DeductSituation and ListGulfQuotes RPCs, fix tsc errors

- Added DeductSituation RPC to intelligence/v1/service.proto (messages
  existed, RPC declaration was missing)
- Added ListGulfQuotes proto + RPC to market/v1/service.proto (handler
  existed, proto was missing)
- Fixed scrapedAt type mismatch in conflict/index.ts (int64 → string)
- Added @ts-nocheck to generated files with codegen type bugs
- Regenerated all sebuf client/server code

* fix(types): fix int64→string type mismatch in list-iran-events.ts
This commit is contained in:
Elie Habib
2026-03-02 22:01:32 +04:00
committed by GitHub
parent 8474092143
commit 363cf5e71c
55 changed files with 563 additions and 1330 deletions

File diff suppressed because one or more lines are too long