[PR #3365] [MERGED] Add data streaming where beneficial to reduce memory usage #6185

Closed
opened 2026-02-05 10:26:24 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/3365
Author: @ssddanbrown
Created: 4/2/2022
Status: Merged
Merged: 4/24/2022
Merged by: @ssddanbrown

Base: developmentHead: data_streaming


📝 Commits (5)

  • 82e8b15 Updated attachment download responses to stream from filesystem
  • 6749faa Fixed streamed outputs in more extreme scenarios
  • cb770c5 Added streamed uploads for attachments
  • 08a8c00 Added streaming support to API attachment read responses
  • 59d1fb2 Fixed tests from streaming changes

📊 Changes

7 files changed (+96 additions, -20 deletions)

View changed files

📝 app/Http/Controllers/Api/AttachmentApiController.php (+23 -5)
📝 app/Http/Controllers/AttachmentController.php (+5 -5)
📝 app/Http/Controllers/Controller.php (+45 -2)
📝 app/Uploads/AttachmentService.php (+15 -4)
📝 resources/views/common/export-styles.blade.php (+1 -1)
📝 tests/Api/AttachmentsApiTest.php (+5 -2)
📝 tests/Uploads/AttachmentTest.php (+2 -1)

📄 Description

Areas to address

  • - Attachment Downloads
  • - Attachment Uploads
  • - API Attachment Downloads
  • - API Attachment Uploads
  • - Image Uploads Upload path already looks to be at reasonable minimum. Resizing is loaded into memory either way. 18MB image on 32MB memory uploads okay.
  • - Image Downloads? Was already streaming.

Todo

  • Test when using s3-like storage for each area
    • Tested on minio, Works very nicely.

Related to #2886


🔄 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/BookStackApp/BookStack/pull/3365 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 4/2/2022 **Status:** ✅ Merged **Merged:** 4/24/2022 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `data_streaming` --- ### 📝 Commits (5) - [`82e8b15`](https://github.com/BookStackApp/BookStack/commit/82e8b1577ec0c7b136da5eed9c89d4790714814c) Updated attachment download responses to stream from filesystem - [`6749faa`](https://github.com/BookStackApp/BookStack/commit/6749faa89a9faa6f21ba173c1736f6bbba72a8f8) Fixed streamed outputs in more extreme scenarios - [`cb770c5`](https://github.com/BookStackApp/BookStack/commit/cb770c534d4d1ac776fb78126fee7b46f57a2f19) Added streamed uploads for attachments - [`08a8c00`](https://github.com/BookStackApp/BookStack/commit/08a8c0070e3f1574ceecd0ea120c26bbf52eb0f4) Added streaming support to API attachment read responses - [`59d1fb2`](https://github.com/BookStackApp/BookStack/commit/59d1fb2d1033616ac7edc143f4876485bb997c6a) Fixed tests from streaming changes ### 📊 Changes **7 files changed** (+96 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `app/Http/Controllers/Api/AttachmentApiController.php` (+23 -5) 📝 `app/Http/Controllers/AttachmentController.php` (+5 -5) 📝 `app/Http/Controllers/Controller.php` (+45 -2) 📝 `app/Uploads/AttachmentService.php` (+15 -4) 📝 `resources/views/common/export-styles.blade.php` (+1 -1) 📝 `tests/Api/AttachmentsApiTest.php` (+5 -2) 📝 `tests/Uploads/AttachmentTest.php` (+2 -1) </details> ### 📄 Description ### Areas to address - [x] - Attachment Downloads - [x] - Attachment Uploads - [x] - API Attachment Downloads - [x] - API Attachment Uploads - [ ] - ~~Image Uploads~~ Upload path already looks to be at reasonable minimum. Resizing is loaded into memory either way. 18MB image on 32MB memory uploads okay. - [x] - Image Downloads? Was already streaming. ### Todo - [x] Test when using s3-like storage for each area - Tested on minio, Works very nicely. ### Related Related to #2886 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:26:24 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6185