dtrb96410 2017-11-28 09:05
浏览 194
已采纳

laravel | 如何确认正在使用哪个缓存驱动程序?

I am trying to use redis in my application but I am not sure if my app is using redis or file driver as I can't create tags but I can create normal keys fine.

I have set CACHE_DRIVER=redis and also in my cache.php I have:

'default' => env('CACHE_DRIVER', 'redis'),

also in my database.php there is:

'redis' => [

    'client' => 'predis',

    'default' => [
        'host' => env('REDIS_HOST', '127.0.0.1'),
        'password' => env('REDIS_PASSWORD', null),
        'port' => env('REDIS_PORT', 6379),
        'database' => 0,
    ],

],

The reasons for my suspicion are I cannot create tags and running redis-cli flushall under homestead(ssh) does not seem to get rid of the cahce. I had to use Cache::flush() in laravel instead.

So How can I effectively find out which cache driver my application is using?

  • 写回答

2条回答 默认 最新

  • dongliang_bj2016 2017-11-28 09:32
    关注

    Its pretty simple , you can use redis cli monitor command to check the get/set are happening or not

    redis-cli monitor
    

    And try to run the application .. if u able to see the keys then redis cache is running

    u can also check the redis key by following command

    redis-cli
    

    Then enter following

    keys *
    

    I hope its useful.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探