nexaas's avatar

sharing cache/queue between laravel and lumen projects

hi everyone, we want to share redis cache and queue between laravel and lumen projects, how can we this.

0 likes
2 replies
bobbybouwmann's avatar

Well you can easily do that because redis itself is not part of the Laravel application right? It's a separated running process. As long if you connect on the same database in redis you should be able to read and write data from both application in Redis.

Do notice that Laravel has a prefix for all the cached items that are stored in redis. You need to make sure that you either remove the prefix or that you make them the same on both application ;)

Laravel cache: https://github.com/laravel/laravel/blob/master/config/cache.php#L101

2 likes
nexaas's avatar

I have changed prefix for both projects same,but still they dont use same cache,

    echo Cache::getPrefix()."\n";
    echo Cache::get('test');

I see output is same for getPrefix() for each other, but value are different, I think there will something else like prefix

Please or to participate in this conversation.