Draft
Conversation
This commit implements comprehensive HTTP caching for RSS feed fetching to significantly reduce server load and bandwidth usage. Changes: - Add database migration for ETag and Last-Modified storage - Implement custom HTTP fetcher with conditional GET support: * If-None-Match header for ETag validation * If-Modified-Since header for Last-Modified validation * Proper User-Agent identification * Gzip/deflate compression support (Accept-Encoding) * HTTP 304 Not Modified handling * HTTP 429/503 with Retry-After support - Replace gofeed's ParseURL() with custom HTTP request + Parse() - Update Feed struct to store cache headers - Update handler to save cache headers after successful fetch - Add FeedCheckResult type to pass cache headers from Check method - Add extensive test suite (20 tests + 2 benchmarks) covering: * ETag and Last-Modified header handling * HTTP 304 responses * Gzip compression * Error handling (429, 503, 404, timeouts) * Concurrent fetches * Edge cases Performance improvements: - 304 responses are 3.4x faster (0.27ms vs 0.9ms) - 304 responses use 136x less memory (6.7KB vs 926KB) - Reduced bandwidth usage through compression and conditional requests - Significantly reduced load on feed servers Implementation follows RSS efficiency best practices from https://www.earth.org.uk/RSS-efficiency.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit implements comprehensive HTTP caching for RSS feed fetching to significantly reduce server load and bandwidth usage.
Changes:
Performance improvements:
Implementation follows RSS efficiency best practices from https://www.earth.org.uk/RSS-efficiency.html
(Made with Claude Code Web, todo: actually test it)