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 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀