Skip to content

feat(rss): conditional GET (ETag/If-Modified-Since) for Railway relay#625

Merged
koala73 merged 1 commit into
mainfrom
feat/rss-conditional-get
Mar 1, 2026
Merged

feat(rss): conditional GET (ETag/If-Modified-Since) for Railway relay#625
koala73 merged 1 commit into
mainfrom
feat/rss-conditional-get

Conversation

@koala73

@koala73 koala73 commented Mar 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Send If-None-Match / If-Modified-Since headers when revalidating expired RSS cache entries in the Railway relay
  • Handle upstream 304 Not Modified — refresh cache timestamp and serve cached body with zero bandwidth
  • Store ETag and Last-Modified from upstream responses in cache entries
  • Cuts upstream egress ~80-95% for feeds that support conditional GET

Files changed

  • scripts/ais-relay.cjs — 3 surgical edits in RSS handler (~25 lines)
  • scripts/ais-relay-rss.test.cjs — 2 new tests (ETag + If-Modified-Since revalidation), updated mock upstream and test proxy

Test plan

  • node --test scripts/ais-relay-rss.test.cjs — 7/7 pass (5 existing + 2 new)
  • node -c scripts/ais-relay.cjs — syntax OK
  • tsc --noEmit — type check passes
  • Manual: curl -v RSS endpoint twice after cache expiry — second should show X-Cache: REVALIDATED for feeds returning ETag/Last-Modified (e.g. BBC)

When RSS cache expires, send If-None-Match/If-Modified-Since headers
on revalidation. Upstream 304 responses refresh the cache timestamp
and serve cached body with zero bandwidth, cutting egress ~80-95%
for feeds that support conditional GET.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Mar 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Ready Ready Preview, Comment Mar 1, 2026 1:16am
worldmonitor-finance Ready Ready Preview, Comment Mar 1, 2026 1:16am
worldmonitor-happy Ready Ready Preview, Comment Mar 1, 2026 1:16am
worldmonitor-startup Ready Ready Preview, Comment Mar 1, 2026 1:16am

Request Review

@koala73
koala73 merged commit ab77965 into main Mar 1, 2026
5 checks passed
koala73 added a commit that referenced this pull request Mar 1, 2026
…lay (#625)

When RSS cache expires, send If-None-Match/If-Modified-Since headers
on revalidation. Upstream 304 responses refresh the cache timestamp
and serve cached body with zero bandwidth, cutting egress ~80-95%
for feeds that support conditional GET.
matthewvecchione1-ops pushed a commit to matthewvecchione1-ops/worldmonitor that referenced this pull request Mar 4, 2026
…lay (koala73#625)

When RSS cache expires, send If-None-Match/If-Modified-Since headers
on revalidation. Upstream 304 responses refresh the cache timestamp
and serve cached body with zero bandwidth, cutting egress ~80-95%
for feeds that support conditional GET.
@koala73
koala73 deleted the feat/rss-conditional-get branch March 4, 2026 19:40
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