I have a question regarding the ajax requests time with Laravel 5. I have the below code:
$.ajax({
type: "POST",
cache: false,
async: false,
url: "/test.php",
data: '_token=' + $("#_token").val() + '&idfoselection=' + id,
success: function(r){}
});
the request time is 1ms-2ms. test.php is an empty file in public folder
If I change the ajax url with a route, (url: "/test-ajax") and inside routes.php I have:
Route::post('test-ajax', ['as' => 'test-ajax', function() {
die;
}]);
the request time is very big, 86ms-100ms.
Is there any way how can I improve this time using Laravel 5? I tried with APC or php artisan optimise...there is a small improvement but is not enough for me.
Thank you