最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

caching - Use not default Cache store with tags in Laravel 9 - Stack Overflow

programmeradmin1浏览0评论

My project use File Cache as default driver. Is it a way to use Redis cache with tags directly? Something like that:

Cache::put('a', 1); // default File Cache used here
Cache::tags('tag')->put('b', 2) // Redis Cache 

cache.php:

return [

    'default' => 'file',

    'stores' => [

        'file' => [
            'driver' => 'file',
            'path' => storage_path('framework/cache/data'),
        ],

        'redis' => [
            'driver' => 'redis',
            'connection' => 'cache',
            'lock_connection' => 'default',
        ],

    ],

];
发布评论

评论列表(0)

  1. 暂无评论