Laravel is a powerful framework, many components, code is also very large, its ease of use is sacrificing performance, even though it is still an excellent framework, but in the formal environment to optimize the speed of the site to improve.
1. Turn off debug
Open the. env file and set debug to False.
PHP
app_env=Localapp_debug=falseApp_key=base64:st/atfeae13eyao1raee6jc9ff+yle1se+ wtyk0h6b4=
2. Cache Routing and Configuration
PHP Artisan Route:cache
PHP Artisan Config:cache
3.Laravel optimization Command
PHP Artisan Optimize
4.composer optimization
sudo composer Dump-autoload optimize
5. Using the Laravel cache
Using the Laravel cache method caches the content, has the file cache, the database cache, the Redis cache, the use of Redis can also be used with Predis components, or a variety of caching methods combined. The use of caching in Laravel is so elegant and convenient:
PHP
$lists = Cache::remember ('travel.destination.lists', function () { return $this->destination->getList ();});
6. Use CDN7. PHP 7 and turn on Opcache8.nginx to turn on gzip compression
Provenance (http://blog.tanteng.me/2016/06/laravel-optimize/)
Optimize Laravel website Opening speed