In Laravel does artisan config:cache actually cache the config as specified in the cache.php settings?

Viewed 575

I have set up Laravel to use Redis as the cache. I can verify that it is working when I use the Cache::('my_var', 'my_val'); then inspecting Redis via the CLI to see that the key already been created.

My question is, after caching the Laravel config with artisan config:cache should I expect to see some entries in Redis since I've set up Laravel to use Redis as the cache?

I currently didn't do it yet, so I'm still wondering if something is configured wrong (and it's caching the config in a file in storage). Or if the actual config already been cached in PHP memory or something so, I shouldn't expect entries in Redis after caching the config.

1 Answers

When you use php artisan config:cache, a static PHP file will be generated on bootstrap\cache\config.php that returns all configs as an array. So the answer to

should I expect to see some entries in redis since I've set up Laravel to use redis as the cache?

is NO, the Laravel won't use your cache driver to cache configs.

Related