Share

When deploying your Laravel Application, I’m certain you need to effective track up to imaginable to make it as performant as it may be. The neighborhood gives many equipment that can assist you in building just like the debugbar and manufacturing applications like HTTP/2 Server Push.

Outside of those, Laravel additionally gives core options to assist accelerate your utility and a type of is configuration caching Artisan command:

php artisan config:cache

This will mix the entire configuration choices into one unmarried document which might be loaded faster by means of the framework, and this bypasses the env helper for taking a look up config pieces in the course of the dotenv bundle, so it is very important make sure you don’t seem to be the use of this any place out of doors of your config information.

Instead of the use of env you’ll be able to and will have to as a substitute use one thing just like the config helper. As an instance:

// Change this to your app code:

env('BUGSNAG_API_KEY');

// To one thing like this:

config('services and products.bugsnag.key');

Once you run the config:cache command two new information might be generated in app/bootstrap/cache/ folder. These are config.php and services and products.php and you’ll be able to glance thru the ones to peer precisely the way it’s compiled down.

Of route, this command isn’t with out some caveats. You will have to best run this in manufacturing as a result of environmental values are designed to modify all the way through native building and every builders device. Secondly, this will have to be setup in order that on deploy the cache is rebuilt, so you might be getting new adjustments every time.

supply By https://laravel-news.com/config-caching