Skip to content

feat(fetch): add conditional fetching with ETag and If-Modified-Since#80

Merged
chaliy merged 1 commit intomainfrom
claude/issue-74-conditional-fetch
Mar 27, 2026
Merged

feat(fetch): add conditional fetching with ETag and If-Modified-Since#80
chaliy merged 1 commit intomainfrom
claude/issue-74-conditional-fetch

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 27, 2026

What

Support conditional HTTP fetching so agents can efficiently poll pages without re-downloading unchanged content.

Why

Agents frequently re-fetch the same URLs in loops. Conditional fetching avoids re-downloading and re-processing unchanged pages, saving bandwidth and time.

How

  • New FetchRequest fields: if_none_match (ETag), if_modified_since
  • New FetchResponse field: etag (returned on all responses)
  • 304 Not Modified handling: return response with status 304, no content, no conversion
  • Fix: 304 is no longer treated as a redirect in the redirect-following logic

Risk

  • Low — additive fields, backward-compatible
  • 304 handling is a new code path but well-tested

Checklist

  • Unit tests passed (3 new conditional fetch tests)
  • Clippy clean
  • Docs build clean

Closes #74

Add if_none_match and if_modified_since fields to FetchRequest for
conditional HTTP requests. Add etag field to FetchResponse. Handle
304 Not Modified responses (no content, no conversion). Fix redirect
logic to not treat 304 as a redirect.

Closes #74
@chaliy chaliy force-pushed the claude/issue-74-conditional-fetch branch from acf2aa1 to 619f815 Compare March 27, 2026 03:15
@chaliy chaliy merged commit 44346e1 into main Mar 27, 2026
10 checks passed
@chaliy chaliy deleted the claude/issue-74-conditional-fetch branch March 27, 2026 03:16
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.

feat: conditional fetching with ETag/If-Modified-Since support

1 participant