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 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog