Skip to content

Use brotli compression#502

Closed
philmcmahon wants to merge 2 commits intouse-java-21from
brotli-java-21
Closed

Use brotli compression#502
philmcmahon wants to merge 2 commits intouse-java-21from
brotli-java-21

Conversation

@philmcmahon
Copy link
Contributor

What does this change?

This PR introduces brotli compression to giant using https://github.com/guardian/play-brotli-filter

The main benefit will be that, for users on slow connections, we're sending a lot less data. For example there is a 75% reduction in the size of the workspaces JSON blob when opening this (large) workspace on playground: https://playground.pfi.gutools.co.uk/workspaces/794bff73-681c-4ab4-b821-d3bb47191a34

Screenshot 2026-01-21 at 13 16 09 Screenshot 2026-01-21 at 13 01 26

The main performance problem for workspaces isn't data transfer time so this won't result in drastic improvements to our larger workspaces unless a user is using a bad internet connection, but seems a nice change nevertheless

Depends on #501

How to test

Tested on playground - doesn't seem to cause any problems with viewing media/pdfs.

@philmcmahon philmcmahon self-assigned this Jan 21, 2026
@philmcmahon philmcmahon requested a review from a team as a code owner January 21, 2026 13:23
@philmcmahon philmcmahon added the feature Departmental tracking: work on a new feature label Jan 21, 2026
@philmcmahon philmcmahon changed the title Brotli java 21 Use brotli compression Jan 21, 2026
@philmcmahon philmcmahon added maintenance Departmental tracking: maintenance work, not a fix or a feature and removed feature Departmental tracking: work on a new feature labels Jan 21, 2026
@philmcmahon
Copy link
Contributor Author

TODO: check cost of compression

@hoyla hoyla linked an issue Jan 23, 2026 that may be closed by this pull request
Copy link
Contributor

@twrichards twrichards left a comment

Choose a reason for hiding this comment

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

that's a lovely reduction in data transfer and definitely useful for slow connections (e.g. my commute into London 😜 )

I think it would be worth measuring how much time that adds to the server (and client) but I think we could do this check by releasing this PR, I've recorded three loads of 17MB workspace...

Image

@philmcmahon
Copy link
Contributor Author

Replaced by #520 - thanks for review though @twrichards !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compress workspace json

2 participants