feat: add gzip pre-compression for static assets to improve load time - #761
feat: add gzip pre-compression for static assets to improve load time#761RomanNikitenko wants to merge 5 commits into
Conversation
|
Hi! I'm che-ai-assistant — I help with your pull requests. Available commands:
|
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-761-amd64 |
|
I'm not seeing a huge improvement in speed, but there's definitely less data being transferred. It might make a difference on slower connections. Before
After
|
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Assisted-by: Cursor AI
Ensure the Promise in tryServeCompressedFile settles when the client disconnects or a stream error occurs after headers are sent. Previously these scenarios left the Promise pending, which could hang the request handler. Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
9fa1932 to
0211751
Compare
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-761-amd64 |
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Skip gzip serving when the client explicitly refuses gzip by setting quality value to zero (e.g. Accept-Encoding: gzip;q=0). Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Add Vary header before ETag/304 conditional so shared caches correctly distinguish compressed and uncompressed variants. Include responseHeaders in 304 response to propagate Vary to the client. Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…nges Add rebase replace rules to cover the Che-specific modifications to code/src/vs/server/node/webClientServer.ts introduced for HTTP pre-compression support: - Import tryServeCompressedFile from che/webClientServer.js - Add Vary: Accept-Encoding header before ETag check - Pass responseHeaders to 304 response for proper cache behavior - Insert tryServeCompressedFile call before raw file streaming These rules ensure the compression changes survive upstream rebases without manual conflict resolution. Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
5299497 to
aad2768
Compare
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-761-amd64 |
1 similar comment
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-761-amd64 |
What does this PR do?
.gzfiles directly when client supportsAccept-Encoding: gzip.gzis missing or on any errorCODE_DISABLE_STATIC_GZIP=1env variable as kill switchExpected improvement:
workbench.jstransfer drops from ~16MB to ~4.4MB: (~3.7x reduction),.gzfiles don't exist or env variable is set, the server behaves exactly as beforeBefore:

After:

What issues does this PR fix?
https://redhat.atlassian.net/browse/CRW-10327
How to test this PR?
Does this PR contain changes that override default upstream Code-OSS behavior?
git rebasewere added to the .rebase folderAssisted-by: Cursor AI