PHP code example of toastnz / dbcache
1. Go to this page and download the library: Download toastnz/dbcache library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
toastnz / dbcache example snippets
// Cache "filters" for 10 minutes under the namespace "product"
DBCache::set('product.filters', json_encode($products), 10);
// Retrieve from cache
DBCache::get('product.filters');
// Remove from cache
DBCache::clear('product.filters');
// Flush cached data for the "product" namespace
DBCache::flush('product');
// Flush all cached data
DBCache::flush();
yml
Toast\DBCache\Extensions\ControllerDBCacheExtension:
clear_on_flush: true