Search code examples
node.jsexpressherokudeployment

My node application takes 10x response time on heroku than local?


I don't know many things about hosting, and i hosted my node app on heroku, but when i fetch api from postman i noticed that it takes 1-2 second if app is sleeping, but even after it takes 500-600 ms. The same api on localhost only takes 50ms. Am i missing something?


Solution

  • If you are using free tier of heroku then, it would take that much time.

    And in case of localhost your server and client are inside the same machine.

    But server is located many kilometers or 1000's of kilometeres away from your system. So, it generally takes that much time.