I have problem with server response time on local project (I am using xampp to host it), it is beetwen 1.3s to 2s. It is pretty annoying, I have about 12 selects like this and all works slow as this. I think it should work much faster.
Here’s screen from network traffic
I am using vuejs (v2.6.12) with axios (v0.21.4), here’s method to get vehicle data from backend:
getVehicleData231() {
this.marki = [];
axios
.get('CommunicationPackage/getJsonVehiclesData231',{
headers: {
'Content-Type': 'application/json'
}
})
.then(response => {
let data = response.data;
console.log(data);
this.marki = data;
})
.catch(error => {
});
},
All I tried to do was select some data from database (MySql) and return it to Vue, I thought query was performance problem, so I turned it into echo with static array(actual code below). Response time didn’t change.
My backend (CodeIgniter v3.1.11) function:
public function getJsonVehiclesData231()
{
$arrayVar = [["name" => "ALFA ROMEO", "code" => "353"]];
echo json_encode($arrayVar);
}
I searched the internet but didn’t ran into anything helpful about slow server response. How could I shorten waiting time to for instance 50ms?
I tried axios with post and get, nothing changed.
At first I tried query from db and I thought it was the problem, but it is not.
I am expecting to get 50-100ms response time from server.
My device spec:
8