-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Labels
v2Version 2 related issuesVersion 2 related issues
Description
Overview
Implement comprehensive network handling for ParseURL including HTTP response metadata, conditional requests, and request configuration using the RequestOptions sub-struct from #244.
Tasks
Request Configuration
- Use RequestOptions from ParseOptions for HTTP configuration:
- Apply custom
Clientif provided - Set
Timeouton HTTP client - Set
UserAgentheader - Apply
AuthConfigfor basic auth
- Apply custom
Conditional Requests
- Implement conditional request support:
- Send
If-None-Matchheader whenIfNoneMatchis set in RequestOptions - Send
If-Modified-Sinceheader whenIfModifiedSinceis set - Return
ErrNotModifiedfor 304 responses - Handle 304 responses gracefully
- Send
Response Metadata
-
Add
ResponseMetadatastruct togofeed.Feed:type ResponseMetadata struct { StatusCode int ETag string LastModified time.Time CacheControl struct { MaxAge *time.Duration MustRevalidate bool NoCache bool NoStore bool } RetryAfter *time.Time Expires *time.Time }
-
Parse and populate HTTP headers:
-
ETagresponse header -
Last-Modifiedheader (parse HTTP date) -
Cache-Controldirectives (max-age, must-revalidate, no-cache, no-store) -
Retry-Afterheader (both HTTP-date and delay-seconds formats) -
Expiresheader
-
Testing & Documentation
- Add comprehensive tests for all network functionality
- Document usage patterns for:
- Conditional requests to reduce bandwidth
- Cache control interpretation
- Retry-After handling for rate limiting
Benefits
- Enable proper HTTP caching strategies
- Support conditional requests to reduce unnecessary fetches
- Provide scheduling hints from HTTP headers
- Better HTTP client configuration support
Related Issues
- Add support for Etag, Last-Modified, If-None-Match and If-Modified-Since http headers on request and response #111 (HTTP ETag, Last-Modified, conditional requests)
- Add support proxy setting for parserURL #165 (Proxy/custom HTTP client support)
- Please consider exposing skipHours (in shared model) #228 (Scheduling hints)
- v2: Implement ParseOptions and Update Parser API #244 (ParseOptions implementation)
Parent Issue
- RFC: gofeed v2 – Proposed Changes #241 (RFC: gofeed v2)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
v2Version 2 related issuesVersion 2 related issues