jeudi 22 décembre 2016

laravel routing issue with domain

I am using laravel version 5.1. I have been using domain routing functionality and have had success with the following code as described in the docs. But the problem is that, When the user visits user.mysite.com, it is taking too much time to load routes. Below is my route:

Route::group(['domain' => 'user.mysite.com'], function ()
{Route::resource('users', 'UserController', ['except' => ['edit', 'create', 'destroy']]);});

As, shown below in the image you can see the time difference it is taking to load routes after loading autoload file.

image for time difference with domain routes

When i do the same thing with prefix instead of domain routes it loads easily without taking time.

Route::group(['prefix' => 'user')], function () 
{Route::resource('users', 'UserController', ['except' => ['edit', 'create', 'destroy']]);});

});

image for time difference with prefix routes

Laravel version is 5.1, Using Apache 2.4.23, and PHP version 5.6.25.

I want to know, Why it is taking this much time, and what is the solution for this.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire