#Taking too long to response json

32 messages · Page 1 of 1 (latest)

fallow barn
#

API response took so long on returning json, but when I dd the data before return its normal and fast. Is there something I need to look up?
Appreciate your help

thorny nexus
#

would you mind to share the relevant code?

#

installing laravel/telescope might helps in debugging as well.

fallow barn
#

This is the function

thorny nexus
#

can't see anything wrong here.

#

are you calling the both requests after $data is cached?

fallow barn
#

yes

#

I see on the telescope all the methods send after the first request is OPTIONS, the first one is GET

thorny nexus
fallow barn
#

no, api.php

#

i used axios in vue app

thorny nexus
#

normally OPTIONS is used to check the CORS token

#

I see.

fallow barn
#

I already configured cors, but sometimes it doesnt work

thorny nexus
fallow barn
thorny nexus
#

wdym by first GET request?

fallow barn
#

my app sending 3 GET requests on the homepage, and only got 1 response in ms/s and the rest are taking minutes also the request method is OPTIONS not GET

thorny nexus
#

if you check the network tab, the OPTIONS requests were succeeded or failed?

fallow barn
#

they run successfully, but took a long time

#

and here are one of the response, the request is red because i return bad request status code. but the response is weird

thorny nexus
#

its seems like the codes took more than 60 seconds(maximum php execution time) to process

#

Probably just check the request details in telescope

fallow barn
#

There are no problems on telescope, it returns 204 for the OPTIONS. and 200 on the GET request, also the queries on the GET requests runs under 3 ms

thorny nexus
#

I am out of clue, tbh.

#

probably wait for the senior to drop by.

fallow barn
#

Thanks for your reply tho, appreciate it

shell bone
#

@fallow barn How are you running your app?

#

artisan serve?

fallow barn
#

yes

#

i've tried virtual host too using laragon, and still the same