Performance: Config caching
Config caching speeds up application boot by loading all config files as a single cached file, reducing file reads and parsing.
Jump into concepts and practice - no test required
php artisan config:cache // Application loads a single cached config file on every request
php artisan serve // Application loads each config file separately on every request
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No config caching (many config files loaded) | N/A (server-side) | N/A | Blocks initial paint due to slower server response | [X] Bad |
| Config caching (single cached config file) | N/A (server-side) | N/A | Faster server response enables quicker initial paint | [OK] Good |
php artisan config:cache in Laravel?php artisan config:cache creates a single cached file from all config files.php artisan config:clear removes the cached config file.cache:clear clears general cache, not config cache; others are invalid commands.php artisan config:cachephp artisan config:clearphp artisan config:cache creates a cached config file for faster loading.php artisan config:clear removes the cached config file, so Laravel loads config files normally again..env file but your Laravel app still uses old config values. What is the most likely cause?.env changes.php artisan config:clear removes cache so Laravel reads updated .env and config files.