Skip to content

chore(backend): update to v176ca82 with HLS window preloading support#207

Merged
mkdir700 merged 1 commit intodevfrom
mkdir700/update-backend
Oct 12, 2025
Merged

chore(backend): update to v176ca82 with HLS window preloading support#207
mkdir700 merged 1 commit intodevfrom
mkdir700/update-backend

Conversation

@mkdir700
Copy link
Owner

@mkdir700 mkdir700 commented Oct 12, 2025

Summary

Update backend submodule to v176ca82, introducing HLS window preloading functionality for improved video playback experience.

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 using asyncio.create_task without blocking user requests
  • Smart Cache Detection: Skip already-cached windows to optimize resource usage and avoid redundant transcoding
  • Priority Management: Low priority (3) for preload tasks to avoid impacting active user requests
  • Performance Metrics: Returns (queued_count, cached_count) metrics for monitoring and debugging

Technical Changes

API Layer (src/app/api/)

  • deps.py: Add get_preload_strategy dependency injection provider
  • v1/jit.py: Auto-trigger preload on window access with asyncio.create_task for non-blocking execution

Configuration (src/app/config/)

  • manager.py: Add preload_previous_windows setting (default: 1, min: 0 to disable)
  • schemas.py: Add preload_previous_windows field to TranscodeConfig schema

Service Layer (src/app/services/)

  • preload_strategy.py: Implement preload_previous_windows method with:
    • Cache key validation to avoid redundant transcoding operations
    • Window ID calculation for determining previous windows
    • Low-priority task queuing for background processing
    • Comprehensive error handling and logging for debugging
    • Metrics tracking (queued_count, cached_count)

Benefits

  • Improved User Experience: Proactively loads likely-needed segments for smoother playback and reduced buffering
  • Performance Optimization: Maintains performance for active requests through priority management
  • Resource Efficiency: Smart cache detection prevents unnecessary transcoding and reduces resource usage
  • Flexibility: Configurable preload count allows tuning based on use case (set to 0 to disable)
  • Monitoring: Built-in metrics for tracking preload effectiveness and cache hit rates

Testing

  • Verify automatic preload triggers on window access
  • Confirm non-blocking behavior doesn't affect user requests
  • Test cache detection skips already-cached windows
  • Validate configurable preload count (0, 1, 2+)
  • Check metrics reporting accuracy

Related Commits

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • 更新后端子模块指针至最新提交,保持代码基线同步。
    • 无用户可见的功能变化、界面改动或性能影响,无需任何操作。

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>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 12, 2025

Walkthrough

将后端子模块指针从 d747012bbd0a394f644939e9c15212ea769274ab 更新为 176ca823ac2e6365f0721e43725c633b2d5aa9da;未发现其他变更,未修改导出/公共声明与控制流。

Changes

Cohort / File(s) Change Summary
子模块指针更新
backend
更新子模块引用提交:d747012b → 176ca823;无其他文件变更

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

我在仓库草丛蹦一蹦,
指针挪一步,提交号轻轻换个风。
没有函数惊醒梦,
没有流程起波澜涌。
只留胡萝卜一根——为平静的小变动🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 标题简洁地反映了后端子模块更新及 HLS 窗口预加载支持,明确总结了 PR 的核心改动。
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mkdir700/update-backend

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 394b93d and 648aa01.

📒 Files selected for processing (1)
  • backend (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test (ubuntu-latest, 20)
  • GitHub Check: test (macos-latest, 20)
  • GitHub Check: test (windows-latest, 20)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mkdir700 mkdir700 merged commit 35cf4ce into dev Oct 12, 2025
4 of 5 checks passed
@mkdir700 mkdir700 deleted the mkdir700/update-backend branch October 12, 2025 11:21
mkdir700 added a commit that referenced this pull request Oct 12, 2025
…#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>
mkdir700 added a commit that referenced this pull request Oct 12, 2025
…#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>
mkdir700 added a commit that referenced this pull request Oct 15, 2025
…#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant