Hello,
I'm trying to use Model Cache. However I wish to delete related cache when I create new record or update record on related model.
This was works
<?php
// Get products without caching
$products = Products::find();
// Just cache the resultset. The cache will expire in 1 hour (3600 seconds)
$products = Products::find(array(
"cache" => array("key" => "my-cache")
));
// Cache the resultset for only for 5 minutes
$products = Products::find(array(
"cache" => array("key" => "my-cache", "lifetime" => 300)
));
// Using a custom cache
$products = Products::find(array("cache" => $myCache));
However when I create new product. Cache still contains old recordset. So I want to delete that cache after creating new product (and after updating or deleting records too ).
My Best Regards