Download src/NetteDatabaseStorage.php
.
Create cache table in your database (see mysql.cache.sql
or
postgres.cache.sql
, you can adapt script for another database server (not tested);
you can change table name).
Instantiate Nette\Caching\Cache
:
$context = new \Nette\Database\Context(...);
$storage = new \Nette\Caching\Storages\DatabaseStorage($context, 'cache_table_name');
$cache = new \Nette\Caching\Cache($storage);
Use it.