gpt4 book ai didi

php - 在 Laravel 中 artisan config :cache actually cache the config as specified in the cache. php 设置?

转载 作者:行者123 更新时间:2023-12-05 02:56:29 30 4
gpt4 key购买 nike

我已将 Laravel 设置为使用 Redis 作为缓存。当我使用 Cache::('my_var', 'my_val'); 然后通过 CLI 检查 Redis 以查看 key 是否已创建时,我可以验证它是否正常工作。

我的问题是,在使用 artisan config:cache 缓存 Laravel 配置后,我是否应该期望在 Redis 中看到一些条目,因为我已经将 Laravel 设置为使用 Redis 作为缓存?

我目前还没有这样做,所以我仍然想知道是否配置有误(它正在将配置缓存在存储文件中)。或者如果实际配置已经缓存在 PHP 内存中或类似的东西中,我不应该期望缓存配置后 Redis 中的条目。

最佳答案

当您使用 php artisan config:cache 时,将在 bootstrap\cache\config.php 上生成一个静态 PHP 文件,以数组形式返回所有配置。所以答案

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

是 NO,Laravel 不会使用你的缓存驱动来缓存配置。

关于php - 在 Laravel 中 artisan config :cache actually cache the config as specified in the cache. php 设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60468419/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com