Cache

High performant and scalable websites require caching. That is why it is built into Bear Framework. The Cache API provides a simple to use methods to store, retrieve and delete data.

use BearFramework\App;

$app App::get();

// Enables a cache driver that will store cache items in the data storage.
$app->cache->useAppDataDriver();

// Save something.
$app->cache->set('key1''data1');

// Get something.
echo $app->cache->getValue('key1'); // Will output 'data1'.

// Delete data from the cache
$app->cache->delete('key1');

Learn more

Handle HTTP requests
Retrieve information about the HTTP request
Store and retrieve data

The information on this page is created for version 1.1 of Bear Framework and may not be applicable for other versions of the framework.