[PR #3860] [MERGED] fix: remove excluded paths from gzip middleware in router initialization #5540

Closed
opened 2026-10-31 20:47:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/3860
Author: @NabiKAZ
Created: 2/26/2026
Status: ✅ Merged
Merged: 3/1/2026
Merged by: @MHSanaei

Base: main ← Head: gzip-exclusions


📝 Commits (1)

  • dad03fc fix: remove excluded paths from gzip middleware in router initialization

📊 Changes

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

View changed files

📝 web/web.go (+1 -1)

📄 Description

What is the pull request?

Previously, the panel/api/ path was included in the gzip middleware excluded paths list for an unknown reason. I could not find any functional or technical justification for excluding this API endpoint from compression, so it has been removed from the exclusion list.

Before:

engine.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedPaths([]string{basePath + "panel/api/"})))

After:

engine.Use(gzip.Gzip(gzip.DefaultCompression))

By allowing gzip compression for panel/api/, the API responses are now properly compressed. As shown in the screenshots, this resulted in approximately 81% reduction in download size and about 71% improvement in transfer speed, improving overall API performance and efficiency.

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

Screenshots

See attached screenshots demonstrating the reduction in response size and improved transfer speed after enabling gzip compression for the API endpoints.
fYBSatzCBa


🔄 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/MHSanaei/3x-ui/pull/3860 **Author:** [@NabiKAZ](https://github.com/NabiKAZ) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 3/1/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `gzip-exclusions` --- ### 📝 Commits (1) - [`dad03fc`](https://github.com/MHSanaei/3x-ui/commit/dad03fc2a74c079226fc8be311bba8629dd18595) fix: remove excluded paths from gzip middleware in router initialization ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `web/web.go` (+1 -1) </details> ### 📄 Description ## What is the pull request? Previously, the `panel/api/` path was included in the gzip middleware excluded paths list for an unknown reason. I could not find any functional or technical justification for excluding this API endpoint from compression, so it has been removed from the exclusion list. Before: ```go engine.Use(gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedPaths([]string{basePath + "panel/api/"}))) ``` After: ```go engine.Use(gzip.Gzip(gzip.DefaultCompression)) ``` By allowing gzip compression for `panel/api/`, the API responses are now properly compressed. As shown in the screenshots, this resulted in approximately **81% reduction in download size and about 71% improvement in transfer speed**, improving overall API performance and efficiency. ## Which part of the application is affected by the change? - [ ] Frontend - [x] Backend ## Type of Changes - [x] Bug fix - [ ] New feature - [ ] Refactoring - [ ] Other ## Screenshots See attached screenshots demonstrating the reduction in response size and improved transfer speed after enabling gzip compression for the API endpoints. <img width="811" height="402" alt="fYBSatzCBa" src="https://github.com/user-attachments/assets/fba02c54-51cf-4877-b6cb-222f605e79f5" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:47:41 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5540
No description provided.