fix: server-side comic page extraction with caching

Fixes #3505 - Large comic books (300+ MB) were unusable due to
client-side extraction.

Changes:
- Add ComicCacheManager for server-side page extraction and caching
- Add GET /api/items/:id/comic-pages endpoint for page metadata
- Add GET /api/items/:id/comic-page/:page endpoint for individual pages
- Update ComicReader.vue to fetch pages on-demand from server
- Add browser-side preloading for adjacent pages

Before: Client downloads entire comic file, extracts in browser
After: Server extracts pages on-demand, caches to disk, streams to client

Performance improvements:
- Initial load: Only metadata request (~1KB) instead of full file (300MB+)
- Page turns: Single image request (~100KB-2MB) with disk caching
- Memory: No longer loads entire archive in browser memory
- Subsequent views: Cached pages served instantly from disk
This commit is contained in:
clawdbot 2026-02-21 11:28:30 -05:00
parent fa5fa7b788
commit 2245d7e9c6
5 changed files with 545 additions and 144 deletions

View file

@ -164,6 +164,8 @@ class Server {
await this.cleanUserData() // Remove invalid user item progress
await CacheManager.ensureCachePaths()
const ComicCacheManager = require('./managers/ComicCacheManager')
await ComicCacheManager.ensureCachePaths()
await ShareManager.init()
await this.backupManager.init()