I can confirm redis cache works for a set of items with dynamic keys like this:
$item = Cache::rememberForever('some_key_name_' . $itemId, function() use($itemId) {
//return from DB...
});
I verify it by looking at the number of DB queries and they decrease. But when I update the item on admin panel, I want the item to be re-queried from database:
Cache::forget('some_key_name_' . $itemId);
What happens is the cache sticks, I see the old item and cache doesn't get cleared with this command.
I didn't use the tagged caching after some research revealed bugs on laravel's github page. What could be the issue with cache forget?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3a9p7tA
via IFTTT
Aucun commentaire:
Enregistrer un commentaire