PHP code example of globalis / wp-cubi-transient-cache
1. Go to this page and download the library: Download globalis/wp-cubi-transient-cache 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/ */
globalis / wp-cubi-transient-cache example snippets
use Globalis\WP\Cubi\TransientCache\Cache;
$my_value = my_expensive_function();
Cache::set('my_key', $my_value, 'my_group');
use Globalis\WP\Cubi\TransientCache\Cache;
$my_value_cached = Cache::get('my_key', 'my_group');
use Globalis\WP\Cubi\TransientCache\Cache;
Cache::clear('my_key', 'my_group');
use Globalis\WP\Cubi\TransientCache\Cache;
Cache::clearGroups(['my_group']);
use Globalis\WP\Cubi\TransientCache\Template;
Template::get('templates/my-part', ['my_arg' => 'example'], 'my_group');
use Globalis\WP\Cubi\TransientCache\Cache;
Cache::clearGroups(['menus']);