Expand description
HTTP client with conditional GET. Owner: fetcher agent.
Frozen public interface — crate::core depends on these exact signatures. Implement
the bodies; do not change the signatures without coordinating with the team lead.
§Requirements
- Build a
reqwest::Clientwith gzip, a sane redirect policy, the given timeout, and the provided User-Agent. - Honor
CachePolicy:NoCache: plain GET, never read or write the cache.MaxAge(d): if a cache entry exists and is younger thand, return it without any network call (from_cache = true,not_modified = true). Otherwise revalidate.CacheFirst: if a cache entry exists, return it without any network call regardless of age (from_cache = true,not_modified = true); only a cache miss falls through to a conditional GET. Used by item lookup so a rolled feed window cannot evict an item the caller already saw (ADR-0014).Revalidate(default): sendIf-None-Match(etag) /If-Modified-Since(last_modified) from the cache entry if present. On304, return the cached body withnot_modified = true,from_cache = true. On200, store the new body + validators (ETag,Last-Modified) in the cache and return it.
- On a non-success, non-304 status, return
RssError::Http. final_urlis the URL after following redirects (used to resolve relative links).
Structs§
- Http
Client - Reusable HTTP client.
- RawFeed
- Raw bytes of a fetched (or cached) feed, plus the metadata
parse/coreneed.