Commit 35cf4ce
chore(backend): update to v176ca82 with HLS window preloading support (#207)
This update brings the following enhancements to the backend:
## New Features
### HLS Window Preloading with Configurable Strategy
- **Automatic Background Preloading**: Automatically preload previous N windows in the background when accessing HLS files
- **Configurable Preload Count**: Add `preload_previous_windows` configuration option (default: 1, min: 0)
- **Non-blocking Execution**: Preload tasks run in background without blocking user requests
- **Smart Cache Detection**: Skip already-cached windows to optimize resource usage
- **Priority Management**: Low priority (3) for preload tasks to avoid impacting active user requests
- **Performance Metrics**: Returns (queued_count, cached_count) metrics for monitoring
## Technical Changes
### API Layer (`src/app/api/`)
- **deps.py**: Add PreloadStrategy dependency injection provider (`get_preload_strategy`)
- **v1/jit.py**: Auto-trigger preload on window access with `asyncio.create_task`
### Configuration (`src/app/config/`)
- **manager.py**: Add `preload_previous_windows` setting (default: 1, min: 0)
- **schemas.py**: Add `preload_previous_windows` field to TranscodeConfig
### Service Layer (`src/app/services/`)
- **preload_strategy.py**: Implement `preload_previous_windows` method with:
- Cache key validation to avoid redundant transcoding
- Window ID calculation for previous windows
- Low-priority task queuing
- Comprehensive error handling and logging
## Benefits
- **Improved User Experience**: Proactively loads likely-needed segments for smoother playback
- **Performance Optimization**: Maintains performance for active requests through priority management
- **Resource Efficiency**: Smart cache detection prevents unnecessary transcoding
- **Flexibility**: Configurable preload count allows tuning based on use case (0 to disable)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 394b93d commit 35cf4ce
1 file changed
Lines changed: 1 addition & 1 deletion
0 commit comments