Skip to content

feat(server-impl): compress /client getConfiguration responses#3991

Open
Korioz wants to merge 1 commit into
citizenfx:masterfrom
SlantingStds:feat/gzip-client-endpoint
Open

feat(server-impl): compress /client getConfiguration responses#3991
Korioz wants to merge 1 commit into
citizenfx:masterfrom
SlantingStds:feat/gzip-client-endpoint

Conversation

@Korioz
Copy link
Copy Markdown
Contributor

@Korioz Korioz commented May 15, 2026

Goal of this PR

Reduce the bandwidth used by POST /client method=getConfiguration endpoint. The server currently sends the response as JSON to every connecting client. On some servers the response can exceeds 10 Mb per client.

This can be an issue with 100 clients connecting at the same time on server restarts this make the server sends a spike of 1 Gbps. With 500+ players this is problematic and requires better bandwidth just for the connection of clients.

How is this PR achieving the goal

  • Server: the /client handler now gzips the JSON body when the client supports it.
  • Client: handles decompression transparently.

Measured on a test server:

  • From 2.51 Mb to 156 Kb (-94 %) per response adding a 30ms compression delay, although results may vary it guarantees an average minimum of -80%.

It should not introduce any breaking changes except if some power users MITM the getConfiguration response 😐

This PR applies to the following area(s)

Server, FiveM, RedM

Successfully tested on

Game builds: Not concerned.
Platforms: Windows.

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions Bot added RedM Issues/PRs related to RedM invalid Requires changes before it's considered valid and can be (re)triaged labels May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged RedM Issues/PRs related to RedM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant