首页 > NodeJs app with Express,cause“request is not finished yet”?

NodeJs app with Express,cause“request is not finished yet”?

As the title said, i use express-session and redis deal with session. code like this:

app.use(session({
    store: new RedisStore({
        "host": "115.28.87.181",
        "port": "6379",
        "ttl": 60 * 60 * 20,
        "pass": "",
        "db": 0,
        "prefix": "session"
    }),
    name: "sessionid",
    secret: '',
    resave: true,
    saveUninitialized: true,
    cookie: {
        path: '/',
        httpOnly: false,
        secure: false,
        maxAge: 60 * 60 * 20
    },
    rolling: true,
    unset: "destroy"
}));

It can store session and works well.

When i request a link like http://127.0.0.1/sign/availd_id?id=tosone make sure which id is available. Problems are coming in Chrome except firefox and safari.

My NodeJs server will response to chrome {code: 200, and wait for a long long time, the browser state is request is not finished yet, and JS is not run.

After a long long time about 2 minutes, Chrome will get the full information {code:200}. it looks like the browser wait for the }.

But the Server Log said it had responsed the whole information to browser long before. the log is this:GET /sign/availd_id?id=tosone 200 73.555 ms, it comes when i refresh the browser.

there is nothing with http keep-alive in my code.

Remove the code above or with firefox, problems will never been like that.


遇到同样的问题,但是没有发现必然规律。唯一可以确认的是:火狐一直好好的,就chrome有问题,而且会偶尔没有问题。


我也遇到这个问题了,
触发条件
1、在用session
2、同时用res.json({code:1, msg:'success'});

就也会出现这个问题,一直要等待2分钟。很诡异。求帮助


关于这个问题我觉得可能是因为用了远程的redis的原因,我尝试着换成了本地的redis就不会出现无限加载的情况了。


  1. 在用express-session

  2. windows 10, chrome 51

  3. 系统升完级就没问题了

【热门文章】
【热门文章】