Thanh

Optimize performance for Laravel application

December 07, 2016 | 1 Minute Read

(writing is in progress)

1. Client side

I prefer to read some tips from Google and CDN provider.

2. Application

  • Take advantage of caching Redis.

  • Some command support for optimize Laravel performance.

composer dump-autoload

php artisan route:cache

php artisan view:clear

php artisan config:clear

php artisan cache:clear

php artisan clear-compiled

php artisan optimize

php artisan route:cache

  • Disalbe query log on production
<?php
public function boot()
{
    if ( env( 'APP_ENV', 'local' ) !== 'local' )
    {
        \DB::connection()->disableQueryLog();
    }
}

References:

3. Server side

4. Learn more about performance