wBB
wBB

Reputation: 851

Nodejs and Express: long time to load page

I've created my first app with Nodejs and Express. It's working fine, but it's slow to load pages when navigating from one route to another. I put a log inside the pages to see what happens and apparently the delay occurs between the page call and the rendering, ie it seems (I think ...) it seems to be the server's time to return the reply, but I'm not sure.

Does anyone know what I can do to decrease page load time?

package.json

{
  "name": "cancela",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "body-parser": "~1.17.1",
    "chart.js": "^2.6.0",
    "cookie-parser": "~1.4.3",
    "debug": "~2.6.3",
    "express": "~4.15.2",
    "log": "^1.4.0",
    "moment": "^2.18.1",
    "morgan": "~1.8.1",
    "mysql": "^2.13.0",
    "pm2": "~2.6.1",
    "pug": "~2.0.0-beta11",
    "serve-favicon": "~2.4.2"
  }
}

Upvotes: 1

Views: 4538

Answers (1)

sheplu
sheplu

Reputation: 2975

Are you in dev mode ? if yes, that's because caching and other way isn't activated. When you will move to production, caching will be activated and your nodejs won't need to reload and parse every html page

But what's your current page load time ?

Upvotes: 1

Related Questions