Phil Skentelbery
c1dd706b8f
feat: Implement Phase 3 Feed Caching (Partial)
Implements feed caching layer with LRU eviction, TTL expiration, and ETag support.
Phase 3.1: Feed Caching (Complete)
- LRU cache with configurable max_size (default: 50 feeds)
- TTL-based expiration (default: 300 seconds = 5 minutes)
- SHA-256 checksums for cache keys and ETags
- Weak ETag generation (W/"checksum")
- If-None-Match header support for 304 Not Modified responses
- Cache invalidation (全体 or per-format)
- Hit/miss/eviction statistics tracking
- Content-based cache keys (changes when notes are modified)
Implementation:
- Created starpunk/feeds/cache.py with FeedCache class
- Integrated caching into feed routes (RSS, ATOM, JSON Feed)
- Added ETag headers to all feed responses
- 304 Not Modified responses for conditional requests
- Configuration: FEED_CACHE_ENABLED, FEED_CACHE_MAX_SIZE
- Global cache instance with singleton pattern
Architecture:
- Two-level caching:
1. Note list cache (simple dict, existing)
2. Feed content cache (LRU with TTL, new)
- Cache keys include format + notes checksum
- Checksums based on note IDs + updated timestamps
- Non-streaming generators used for cacheable content
Testing:
- 25 comprehensive cache tests (100% passing)
- Tests for LRU eviction, TTL expiration, statistics
- Tests for checksum generation and consistency
- Tests for ETag generation and uniqueness
- All 114 feed tests passing (no regressions)
Quality Metrics:
- 114/114 tests passing (100%)
- Zero breaking changes
- Full backward compatibility
- Cache disabled mode supported (FEED_CACHE_ENABLED=false)
Performance Benefits:
- Database queries reduced (note list cached)
- Feed generation reduced (content cached)
- Bandwidth saved (304 responses)
- Memory efficient (LRU eviction)
Note: Phase 3 is partially complete. Still pending:
- Feed statistics dashboard
- OPML 2.0 export endpoint
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 21:14:03 -07:00
..
2025-11-26 14:54:52 -07:00
2025-11-18 19:21:31 -07:00
2025-11-18 23:01:53 -07:00
2025-11-24 19:41:39 -07:00
2025-11-19 14:51:30 -07:00
2025-11-26 14:54:52 -07:00
2025-11-26 14:54:52 -07:00
2025-11-27 21:14:03 -07:00
2025-11-26 14:54:52 -07:00
2025-11-27 20:46:49 -07:00
2025-11-25 11:03:28 -07:00
2025-11-25 20:10:41 -07:00
2025-11-24 17:16:28 -07:00
2025-11-18 19:21:31 -07:00
2025-11-26 14:13:44 -07:00
2025-11-18 23:01:53 -07:00
2025-11-22 18:22:08 -07:00
2025-11-24 17:16:28 -07:00
2025-11-25 20:10:41 -07:00
2025-11-27 20:46:49 -07:00
2025-11-24 17:23:46 -07:00
2025-11-25 10:34:00 -07:00
2025-11-25 10:34:00 -07:00
2025-11-25 10:34:00 -07:00
2025-11-24 17:23:46 -07:00
2025-11-18 19:21:31 -07:00