samedi 30 juillet 2016

Laravel basic auth slow performance

I'm implementing an API using Laravel5 with MySQL database. The endpoints are very simple: there is 'customers' table and API CRUDs it's data.

The problem is the following:

API endpoints are protected by Basic HTTP-auth, implemented by standard Laravel5 functionality in middleware

$response = $this->auth->guard($guard)->basic();

And it has very slow performance. Curl trace shows, that with this middleware enabled the request is processed during 0.6 sec. Without this middleware - during 0.2 sec.

To my mind it is too much to just fetch one row from a simple table.

Do you know the possibilities, how to make this auth work faster. Maybe use another type of auth or implement custom Basic Auth Middleware where just check for login/pass in database?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2a7dtEf
via IFTTT

Aucun commentaire:

Enregistrer un commentaire