Is that a new project or an old one? If new then try on other server. If old then try new install and see how it behaves.
Oct 25, 2020
4
Level 1
Api route throttling by default
Jetstream / Inertia
protected $middlewareGroups = [
'api' => [
EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
by default throttle:api enabled in api section. When I doing axios.get(/api/user) or any other api route, I got answer delay 3-4 sec and huge load on server (CPU) even if I request this route 1 time per 3 sec. Even if in route just closure which return immediatly.
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return 1;
});
Why this happens? If I disabling 'throttle:api' - all works fine and I got answer from endpoint in 80-100ms
Please or to participate in this conversation.