Skip to content

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

@chaliy

Description

@chaliy

What

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

Approach

  • Add etag and last_modified to FetchResponse (already have last_modified)
  • Add if_none_match (ETag) and if_modified_since fields to FetchRequest
  • When server returns 304 Not Modified, return response with status_code: 304 and no content
  • Return etag header value in response for future conditional requests

Why

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

Acceptance criteria

  • New request fields: if_none_match, if_modified_since
  • New response field: etag
  • 304 responses handled correctly (no content, no conversion)
  • Tests with wiremock covering conditional request/response flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions