TL;DR : Livewire ajax request takes 70ms on my localhost, but it takes somewhere between 2 and 8 seconds on both my client's computer's localhost, and on the server (I've seen it take as long as 20 seconds).
I've built a site for a client a month ago and it's still haunting me because of its speed problems, I have cached almost everything there is to cache but still a simple livewire request (to get data from cache - no db queries) takes somewhere between 1.5 to 4 seconds.
The app is very simple, shows restaurant tables on homepage, where you can click on them to view and see/add orders.
On the table page I have 4 livewire components,
-
table-categories component : Lists food/product categories (data comes from cache, only using livewire to emit an event to the following component)
-
table-products component : Shows a list of all its food items when clicked on a category, also cached by category id.
-
table-options component : After selecting the food, select quantity, portion, ingredients, notes etc. and click a button to create an order.
-
table-orders component : A list of all the products that table has ordered, this one makes a query but it is eager loaded, extremely efficient and polls every 5 seconds just in case another waiter has changed/took an order from the same table.
Here's my network tab when I select a category. (Disregard xhr ones, they're from debugbar)

But today I installed the same exact laravel app, with same exact database on my client's computer all these requests took longer than 1-2 seconds "each".
Here's the details page of one of those ajax requests, from my client's computer. Literally running the same way as it does on my own pc, php artisan serve (sorry for bad quality)

And this is how it looks on the server :

The code that runs on these actions are nothing more than getting data from cache. There's not a single database query running.
At first I wanted to blame the hosting company, after a lot of support tickets today I went to my client to install the site on their machine locally until I can fix the problem, and I saw it's not much better than the server on their machine as well. Again, same exact code, same exact database.
I'm not sure what else I'm supposed to do. Suggest them to change the hosting provider? Give them my own computer? I've spent an entire month optimizing the site, and I've done pretty much everything I can at this point.
I'm sorry if I over/undershared. I have never dealt with servers other than my own localhost before.