From f59e8d8642bfc60cba36ef74156d05bcf29ec889 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Sat, 5 May 2018 10:55:55 +0200 Subject: [PATCH] (feat): Item key call for deletion --- components/cache/cache_invalidation.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/cache/cache_invalidation.rst b/components/cache/cache_invalidation.rst index eb5bdf6cfa1..df1b1f3b893 100644 --- a/components/cache/cache_invalidation.rst +++ b/components/cache/cache_invalidation.rst @@ -48,6 +48,9 @@ you can invalidate the cached items by calling // if you know the cache key, you can also delete the item directly $cache->deleteItem('cache_key'); + // If you don't remember the item key, you can use the getKey() method + $cache->deleteItem($item->getKey()); + Using tags invalidation is very useful when tracking cache keys becomes difficult. Tag Aware Adapters