Laravel 5.2 Cached Tags Not Working

I am using Laravel 5.2 cache with memcached driver.

tried to implement Cache :: tags in my project but it doesn't seem to work.

But it works well when I use

Cache::put('user_1', $user, 600);

Here is my code

Cache::tags('user')->put('user_1', $user, 600);

and I tried to use

Cache::tags(['user'])->put('user_1', $user, 600);

as mentioned in the API docs that said the array is supported | mixed $ names

Not sure if anyone has a similar problem like me?

+4
source share
1 answer

It also confused me. When using cache tags with Laravel to retrieve stored data from the cache, you need to specify the tags used.

. :

Cache::tags('user')->put('user_1', $user, 600);

:

Cache::get('user_1');

:

Cache::tags('user')->get('user_1');

Laravel 5.4 ( ).

+1

All Articles