[PR #3714] [MERGED] Change: no compression when downloading library item as zip file #4059

Closed
opened 2026-04-25 00:18:09 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3714
Author: @nichwall
Created: 12/14/2024
Status: Merged
Merged: 12/25/2024
Merged by: @advplyr

Base: masterHead: zip_download_speedup


📝 Commits (1)

  • 6172988 Change: no compression when downloading library item as zip file

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 server/utils/zipHelpers.js (+2 -2)

📄 Description

Brief summary

This PR speeds up the endpoint for downloading the zip of a library item by removing compression.

Which issue is fixed?

Partially fixes https://github.com/advplyr/audiobookshelf/issues/3081

In-depth Description

Removing compression on downloads for library items greatly reduces CPU usage (removes costly compression, just streams directly from file to response). This does increase file size by about 2-3%, but removes the limit of 10-15 MBps (depending on hardware) for downloading a zip file. Compressing already compressed files does not really save any bandwidth. More discussion in https://github.com/advplyr/audiobookshelf/issues/3081#issuecomment-2526359501

This can increase download time if the network connection is slower than 10 MBps by about 2-3% due to the file size being slightly larger.

I did investigate adding the Content-Length header to give users a better "estimated time remaining", but this ended up being a bit difficult due to the length of the zip file not being a direct sum of each file size. https://stackoverflow.com/questions/10927442/calculate-size-of-zip-file-with-compression-level-0/19380600#19380600

How have you tested this?

I have tested downloading over Ethernet, WiFi, and cellular data to benchmark each connection.

Screenshots

N/A


🔄 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/3714 **Author:** [@nichwall](https://github.com/nichwall) **Created:** 12/14/2024 **Status:** ✅ Merged **Merged:** 12/25/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `zip_download_speedup` --- ### 📝 Commits (1) - [`6172988`](https://github.com/advplyr/audiobookshelf/commit/61729881cb0bfca2f7a22da06597713acbc043b2) Change: no compression when downloading library item as zip file ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/zipHelpers.js` (+2 -2) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary This PR speeds up the endpoint for downloading the zip of a library item by removing compression. ## Which issue is fixed? Partially fixes https://github.com/advplyr/audiobookshelf/issues/3081 ## In-depth Description Removing compression on downloads for library items greatly reduces CPU usage (removes costly compression, just streams directly from file to response). This does increase file size by about 2-3%, but removes the limit of 10-15 MBps (depending on hardware) for downloading a zip file. Compressing already compressed files does not really save any bandwidth. More discussion in https://github.com/advplyr/audiobookshelf/issues/3081#issuecomment-2526359501 This can increase download time if the network connection is slower than 10 MBps by about 2-3% due to the file size being slightly larger. I did investigate adding the `Content-Length` header to give users a better "estimated time remaining", but this ended up being a bit difficult due to the length of the zip file not being a direct sum of each file size. https://stackoverflow.com/questions/10927442/calculate-size-of-zip-file-with-compression-level-0/19380600#19380600 ## How have you tested this? I have tested downloading over Ethernet, WiFi, and cellular data to benchmark each connection. ## Screenshots N/A --- <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:18:09 +02:00
adam closed this issue 2026-04-25 00:18:09 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4059