How to delete all the cache using predis in php

Lionel Dcosta picture Lionel Dcosta · Aug 31, 2016 · Viewed 8.3k times · Source

I am using predis library to cache the data. I am able to delete the cache individually using

$redis->cache->hdel(self::$cacheNamespace, $key);

But i need to delete all the cache without providing any keys, Is there a way to achieve that in predis.

Answer

Noman picture Noman · Aug 31, 2016

With Cache Clear All, Here you go:

cache_clear_all();

For my point of view, You have to use redis cli:

redis-cli flushall

For more info FlushAll.