Hi. So I am caching queries in multiple places, just like the example below. My question is, can I somehow send a key when I use query caching, a key which I could use later to call the delete() method of the caching class?
I’m asking because sometimes, I just want to clear one query cache. Calling flush() would delete everything.
How could I delete individual query caches?
Can I do this? Thank you.
$customer = $db->cache(function (Connection $db) {
return $db->createCommand('SELECT * FROM customer WHERE id=1')->queryOne();
});