Skip to content

Instantly share code, notes, and snippets.

@manchumahara
Created August 25, 2018 11:27
Show Gist options
  • Save manchumahara/3ce66d605122d6ea659b278fb65885bd to your computer and use it in GitHub Desktop.
Save manchumahara/3ce66d605122d6ea659b278fb65885bd to your computer and use it in GitHub Desktop.
Key Value Caching in Joomla part 2 https://codeboxr.com/key-value-caching-in-joomla/
if ( false === ( $cache_data = $cache->get( 'your_key_here', '' ) ) ) {
// we are here, means there is no data in cache. so let's put something in cache
$cache_data = 'I fucking love Joomla documentation!';
//now cache the data $cache_data
$cache->store($data, 'your_key_here', '' ); //if cache stored
}
//$cache_data is the data we get from cache
var_dump($cache_data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment