[PR #5078] fix: server-side comic page extraction with caching #4417

Open
opened 2026-04-25 00:19:40 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/5078
Author: @mattmanning
Created: 2/21/2026
Status: 🔄 Open

Base: masterHead: fix/comic-performance-3505


📝 Commits (3)

  • 2245d7e fix: server-side comic page extraction with caching
  • c6c8b37 fix: make comic-page endpoint public (like covers)
  • c7d4a0c fix: add comic-page to auth bypass patterns

📊 Changes

6 files changed (+562 additions, -145 deletions)

View changed files

📝 client/components/readers/ComicReader.vue (+112 -144)
📝 server/Auth.js (+5 -1)
📝 server/Server.js (+2 -0)
📝 server/controllers/LibraryItemController.js (+139 -0)
server/managers/ComicCacheManager.js (+301 -0)
📝 server/routers/ApiRouter.js (+3 -0)

📄 Description

Brief summary

Server-side comic page extraction with caching to fix slow page loads for large CBR/CBZ files.

Which issue is fixed?

Fixes #3505

In-depth Description

Large comic books (300+ MB) were causing 30-60 second page turns because the web client downloaded the entire archive before extracting pages client-side.

Solution:

  • New ComicCacheManager extracts pages on-demand and caches to disk
  • New endpoint GET /api/items/:id/comic-pages returns page list metadata
  • New endpoint GET /api/items/:id/comic-page/:page returns individual pages
  • Updated ComicReader.vue to fetch pages individually
  • Browser preloads 2 pages ahead, 1 behind

Performance:

Metric Before After
Initial load Entire file (300MB+) Metadata (~1KB)
Page turn Re-extract from memory Single image (~2MB)
Browser memory Entire archive Current page only

How have you tested this?

  1. Built Docker image, deployed to local Audiobookshelf (v2.32.1)
  2. Tested with Chainsaw Man CBZ (189 pages)
  3. Browser automation verified: pages load, navigation works, preloading works

Environment: Docker/Linux, Chrome

Screenshots

Pages load instantly instead of 30-60s wait.


Note: Companion mobile app PR: advplyr/audiobookshelf-app#1809


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/5078 **Author:** [@mattmanning](https://github.com/mattmanning) **Created:** 2/21/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/comic-performance-3505` --- ### 📝 Commits (3) - [`2245d7e`](https://github.com/advplyr/audiobookshelf/commit/2245d7e9c66af2b5a1cfd0134cbde50d64b1977c) fix: server-side comic page extraction with caching - [`c6c8b37`](https://github.com/advplyr/audiobookshelf/commit/c6c8b378ab42fb1c78c8c359b422ffaaef230eaa) fix: make comic-page endpoint public (like covers) - [`c7d4a0c`](https://github.com/advplyr/audiobookshelf/commit/c7d4a0cba89eff2de7b1613de3835fc379b4af80) fix: add comic-page to auth bypass patterns ### 📊 Changes **6 files changed** (+562 additions, -145 deletions) <details> <summary>View changed files</summary> 📝 `client/components/readers/ComicReader.vue` (+112 -144) 📝 `server/Auth.js` (+5 -1) 📝 `server/Server.js` (+2 -0) 📝 `server/controllers/LibraryItemController.js` (+139 -0) ➕ `server/managers/ComicCacheManager.js` (+301 -0) 📝 `server/routers/ApiRouter.js` (+3 -0) </details> ### 📄 Description ## Brief summary Server-side comic page extraction with caching to fix slow page loads for large CBR/CBZ files. ## Which issue is fixed? Fixes #3505 ## In-depth Description Large comic books (300+ MB) were causing 30-60 second page turns because the web client downloaded the entire archive before extracting pages client-side. **Solution:** - New `ComicCacheManager` extracts pages on-demand and caches to disk - New endpoint `GET /api/items/:id/comic-pages` returns page list metadata - New endpoint `GET /api/items/:id/comic-page/:page` returns individual pages - Updated `ComicReader.vue` to fetch pages individually - Browser preloads 2 pages ahead, 1 behind **Performance:** | Metric | Before | After | |--------|--------|-------| | Initial load | Entire file (300MB+) | Metadata (~1KB) | | Page turn | Re-extract from memory | Single image (~2MB) | | Browser memory | Entire archive | Current page only | ## How have you tested this? 1. Built Docker image, deployed to local Audiobookshelf (v2.32.1) 2. Tested with Chainsaw Man CBZ (189 pages) 3. Browser automation verified: pages load, navigation works, preloading works **Environment:** Docker/Linux, Chrome ## Screenshots Pages load instantly instead of 30-60s wait. --- **Note:** Companion mobile app PR: advplyr/audiobookshelf-app#1809 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:19:40 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4417