Skip to content

Conversation

@MartinaeyNL
Copy link

@MartinaeyNL MartinaeyNL commented Jan 26, 2026

Description

Fixes #13

As a simple test, I tried out this HAProxy config locally to experiment if the Manager UI would load properly.
I'm not an expert in HAProxy nor any proxy application, so it was just a simple attempt 😉
I looked at the official documentation, and made adjustments based on that.

It seems to correctly apply the GZip compression, and significantly reduce the download sizes.
For example, the Manager UI bundle went down from 6.5MB to about 2.7MB.

Any feedback on this is welcome 👍

Changelog

  • Adds GZip compression to HTML, CSS, JavaScript, JSON, and SVG files from the Manager backend.

@MartinaeyNL MartinaeyNL requested a review from a team January 26, 2026 15:30
@MartinaeyNL MartinaeyNL self-assigned this Jan 26, 2026
@MartinaeyNL MartinaeyNL added the Enhancement Improvement of an existing feature label Jan 26, 2026
@MartinaeyNL
Copy link
Author

MartinaeyNL commented Jan 26, 2026

Maybe we should add a minimum file size as described here in their documentation.
Will do that quickly.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds GZip compression to the HAProxy configuration for the Manager backend to reduce download sizes for web assets. Testing shows the Manager UI bundle size decreased from 6.5MB to approximately 2.7MB. The change adds compression directives to the manager_backend section of the HAProxy configuration.

Changes:

  • Adds GZip compression configuration to the manager_backend in HAProxy
  • Configures compression for HTML, CSS, JavaScript, JSON, and SVG MIME types
  • Sets minimum response size of 1500 bytes for compression eligibility
  • Enables compression offload to prevent double compression

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MartinaeyNL MartinaeyNL marked this pull request as ready for review February 3, 2026 15:09
haproxy.cfg Outdated
backend manager_backend
compression algo gzip deflate # Enable compression
compression type text/html text/css application/javascript application/json image/svg+xml
compression minsize-res 1500
Copy link

@dominiquekleeven dominiquekleeven Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running the proxy image with the updated haproxy.cfg, results in the following error:

[NOTICE]   (20) : haproxy version is 2.9.15-e872a3f
[ALERT]    (20) : config : parsing [/etc/haproxy/haproxy.cfg:148] : 'compression' expects 'algo', 'type' 'direction' or 'offload'
[ALERT]    (20) : config : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT]    (20) : config : Fatal errors found in configuration.
[ERROR][2026-02-03 16:46:47] Cannot start proxy until config file errors are resolved in '/etc/haproxy/haproxy.cfg'

Removing the following line resolves it.

compression minsize-res 1500

minsize-res was added in HAProxy version 3.2, see https://www.haproxy.com/documentation/haproxy-configuration-tutorials/performance/compression/#set-a-minimum-file-size

We are currently using version 2.9. It might be OK to remove the minsize, or maybe try bumping the version to 3.2

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Maybe we should indeed create an issue for doing the upgrade.
I'll remove that minsize-res line for this PR 👍

@MartinaeyNL
Copy link
Author

Thanks for the review @dominiquekleeven , good catch there 👍
Processed the changes, and ready for a review again.

@MartinaeyNL MartinaeyNL requested a review from a team February 4, 2026 08:49
@wborn wborn requested a review from Copilot February 4, 2026 09:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +146 to +148
compression algo gzip deflate # Enable compression
compression type text/html text/css application/javascript application/json image/svg+xml
compression offload
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compression configuration is only applied to the manager_backend but not to the keycloak_backend at line 154. If the Keycloak backend also serves compressible content (HTML, CSS, JavaScript, JSON), it should also benefit from compression. Consider whether compression should be applied consistently across all backends or if there's a specific reason to exclude Keycloak.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add compression

3 participants