🚅 chore: Added an Example of Nginx gzip Settings #3173
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I have added an example gzip settings to
nginx.conf
.Details
LibreChat currently requires loading nearly 4MB of JavaScript before the initial screen is displayed, causing delays, especially on slower connections. To address this, I’ve added configuration options to compress transferred files in
nginx.conf
.Refer to this documentation for more details:
Note that this PR does not include font or image compression, as they are typically already compressed and would offer minimal benefits relative to server load.
the Lighthouse metrics without gzip enabled:
the Lighthouse metrics with gzip enabled:
Transfer size without gzip enable:
Transfer size with gzip enable:
This configuration significantly reduces transfer sizes.
In the future, we might want to consider code splitting to improve the initial loading time. For now, this configuration should significantly improve performance.
Change Type
Testing
I have confirmed that the file transfer size is reduced when this setting is enabled.
Checklist
Please delete any irrelevant options.