Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7647719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:31:59+00:00 2026-05-31T10:31:59+00:00

Express and connect appeared to have removed their gzip functions because they were too

  • 0

Express and connect appeared to have removed their gzip functions because they were too inefficient. Are there any reliable solutions to gzip with express-js currently?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:32:00+00:00Added an answer on May 31, 2026 at 10:32 am

    Connect 2.0 has added support for compress() middleware based on the new zlib stuff with that has just come out in Node Core API.

    You can make use of this in your express server by adding a dependency to connect 2.0 in your package.json file:

    {
        ...
        dependencies: {
            "connect" : "2.x",
            "express" : "2.x",
            // etc..
        }
    }
    

    And then apply the following logic into your express app configuration:

    // Create static file server with gzip support
    var app = express.createServer(express.logger());
    app.use(connect.compress());
    app.use(express.static(__dirname + '/public'));
    app.listen(80);
    

    Please note that this stuff is still pretty new and while I could get it to work locally, my Heroku cloud application complained about the dependency on Compress 2.x during the pre-commit hook when deploying via git:

    -----> Heroku receiving push
    -----> Node.js app detected
    -----> Resolving engine versions
           Using Node.js version: 0.4.7
           Using npm version: 1.0.106
    -----> Fetching Node.js binaries
    -----> Vendoring node into slug
    -----> Installing dependencies with npm
           npm ERR! Error: No compatible version found: connect@'>=2.0.0- <3.0.0-'
    

    As you can see, they’re still using an old version of node (0.4.7).


    UPDATE:

    Actually, I could get Heroku to deploy this by adding the corresponding engines section in the package.json:

    {
        ...
        "engines": {
            "node": ">= 0.6.0 < 0.7.0"
        }
    }
    

    And these are the results when using a http compression tester:

    enter image description here

    UPDATE June 2014

    Hiya, if you are reading this now. Dont forget that the stuff above is only relevant to Express 2.0.

    Express 3.0 and 4.0 use different syntax for enabling http compression, see post by gasolin just below.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed team foundation server 2012 express and am wanting to connect through
I'm using node, express and connect for a simple app and have basic HTTP
I have been reading up a little on the source for Connect and Express
I'm working on setting up authentication with connect-auth on express & mongoose but there
I have installed SQL server 08 express edition and then tried to connect using
I have an Express.js app that uses connect-asssets to serve JS and CSS: app.configure(function()
I'm using a customized version of the vhost connect/express middleware and inside it I
Here is my app: var express = require('express'), app = express.createServer(), RedisStore = require('connect-redis')(express);
I'm trying to connect to a MS SQL Server 2005 Express database that is
In my application I want to connect SQL Server Express with Hibernate. But I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.