Hi together,
im would like to clear cache for a specific cache config.
Therefore i have this setup:
config setup local environment
'products-queries' => [
'className' => FileEngine::class,
'duration' => '+1 day',
'probability' => 100,
'path' => CACHE . 'queries' . DS . 'products' . DS,
],
config setup production environment
'products-queries' => [
'className' => ApcuEngine::class,
'duration' => '+1 day',
'probability' => 100,
'path' => CACHE . 'queries' . DS . 'products' . DS,
],
the cache is created at this point at ProductsController
public function index()
{
// some code
$query = $this->Products->makeProductsIndexQuery($productsConditions, $this->getRequest()->getQueryParams());
$products = $query->cache('products-' . $this->productConditionsHash, 'products-queries');
try {
$this->set('products', $this->paginate($products, [
'sortWhitelist' => [
'Products.price',
'Products.reduced_price',
'Products.least_price',
'Products.created',
'Products.min_delivery_time',
'Products.sold_quantity_six_months',
],
]));
} catch (\Cake\Network\Exception\NotFoundException $e) {
}
$this->render('index');
}
within an edit function at admin i fire the cache command
Cache::clear(true, 'products-queries');
but the cache is not deleted
using this
Cache::clear(false);
all caches are cleared, but this is what i want to avoid
what i’m missing here?