'Why API time has different when everything is the same on live server than local?

Recently I made a eCommerce website using laravel as api. Everything is working fine but there is one thing bothering me. In my live server the average request is 1s or more.. , and in localhost is 300ms [average] - Takes twice the time. I can't understand why that happens.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source