Skip to content

feat(server): add compression support for production server#8595

Open
Jack-sh1 wants to merge 3 commits into
web-infra-dev:mainfrom
Jack-sh1:feat/server-compression
Open

feat(server): add compression support for production server#8595
Jack-sh1 wants to merge 3 commits into
web-infra-dev:mainfrom
Jack-sh1:feat/server-compression

Conversation

@Jack-sh1
Copy link
Copy Markdown
Contributor

@Jack-sh1 Jack-sh1 commented May 7, 2026

Summary

Add gzip/br/deflate compression middleware for the production server via server.compression config option.

This allows developers to enable response compression without relying on a reverse proxy like nginx.

Usage:

// modern.config.ts

export default defineConfig({

  server: {

    compression: true, // gzip by default

    // or: compression: { encoding: 'br' }

  },

});


## Related Links

Closes #6920

## Checklist

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->

- [ ] I have added changeset via `pnpm run change`.
- [ ] I have updated the documentation.
- [ x] I have added tests to cover my changes.

- Fix "unkown" -> "unknown" in streaming error message
- Fix "preResovled" -> "preResolved" in comment
- Fix "createRemixReuqest" -> "createRemixRequest" function name
The generated modern-app-env.d.ts is missing the @rsbuild/core/types
reference, causing TypeScript errors for import.meta.env.DEV and
other Rsbuild built-in environment variables.

Closes web-infra-dev#8522
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 16769ee

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for modernjs-byted ready!

Name Link
🔨 Latest commit 16769ee
🔍 Latest deploy log https://app.netlify.com/projects/modernjs-byted/deploys/69fccac6e11dc80008b84c45
😎 Deploy Preview https://deploy-preview-8595--modernjs-byted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant