Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 22, 2022 07:20 am GMT

Speed Up Your Laravel Website Super Fast- Codexashish

Speed Up Your Laravel website Super Fast

Laravel is the best back-end framework of PHP, and lots of companies are choosing Laravel for their large and medium-sized projects. SEO is incredibly important for each website. there are some tips you'll follow to create your laravel app super fast. So let's Start:-

1. Use Caching in production:

Each time you boot your laravel app , your app determines the middleware, resoles aliases, resolves route groups, and identifies the controller action and parameter inputs for each single route entry. so you'll be able to think how bad it's for your app within the production.

You can bypass route processing by caching all routes running this so.:-

php artisan route:cache

What about configuration caching ?? to bypass parsing your .env and config files on every app boot you must run:-

php artisan config:cache

use config() to access .env variables , avoid using env()

you must not compile your views whenever, just use pre-compiled blade template views, to try and do that run this command.

php artisan view:cache

**To cache a manifest of all of your app's events and listeners

run :**

php artisan event:clear

_Recreate boostrap/cache/compiled.php _

php artisan optimize

Alert :

You need to clear the cache to reflect any new changes by using the commands:

php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache

2. Remove Dev dependencies from the composer

When you develop your project likely you may be using some Dev packages to trace queries or other development things, remove those packages that aren't required within the production.

So just run one command within the production and then.:

composer install --prefer-dist --no-dev -o

Click Here to read more

Thankyou
Codexashish


Original Link: https://dev.to/mailashish/speed-up-your-laravel-website-super-fast-codexashish-60o

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To