PHPackages                             bnomei/kirby3-mysql-cachedriver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. bnomei/kirby3-mysql-cachedriver

ActiveKirby-plugin[Database &amp; ORM](/categories/database)

bnomei/kirby3-mysql-cachedriver
===============================

MySQL based Cache-Driver

1.3.2(3y ago)124MITPHPPHP &gt;=7.4.0

Since Dec 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bnomei/kirby3-mysql-cachedriver)[ Packagist](https://packagist.org/packages/bnomei/kirby3-mysql-cachedriver)[ Fund](https://buymeacoff.ee/bnomei)[ Fund](https://paypal.me/bnomei)[ RSS](/packages/bnomei-kirby3-mysql-cachedriver/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (11)Used By (0)

🐬 Kirby MySQL Cache-Driver
==========================

[](#-kirby-mysql-cache-driver)

[![Release](https://camo.githubusercontent.com/8b16aa46dd482301de8d7e8981dfa566b526be78b4c5a556a150fe2250653337/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f626e6f6d65692f6b69726279332d6d7973716c2d63616368656472697665723f636f6c6f723d6165383166662669636f6e3d676974687562266c6162656c)](https://camo.githubusercontent.com/8b16aa46dd482301de8d7e8981dfa566b526be78b4c5a556a150fe2250653337/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f626e6f6d65692f6b69726279332d6d7973716c2d63616368656472697665723f636f6c6f723d6165383166662669636f6e3d676974687562266c6162656c)[![Discord](https://camo.githubusercontent.com/36eaef1b06f4996feb7587aa3281dcbd658e57535bc6b5e10110ed108e7a7a03/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f646973636f72642f626e6f6d65693f636f6c6f723d3732383964612669636f6e3d646973636f7264266c6162656c)](https://discordapp.com/users/bnomei)[![Buymecoffee](https://camo.githubusercontent.com/62e55d1129b82bf9c2fd4656451e81ab87a9787e7c9676ca58276532ed9666ee/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f69636f6e2f646f6e6174653f69636f6e3d6275796d6561636f6666656526636f6c6f723d464638313346266c6162656c)](https://www.buymeacoffee.com/bnomei)

Dolphin - a MySQL Cache Driver for Kirby

Installation
------------

[](#installation)

- unzip [master.zip](https://github.com/bnomei/kirby3-mysql-cachedriver/archive/master.zip) as folder `site/plugins/kirby3-mysql-cachedriver` or
- `git submodule add https://github.com/bnomei/kirby3-mysql-cachedriver.git site/plugins/kirby3-mysql-cachedriver` or
- `composer require bnomei/kirby3-mysql-cachedriver`

Usage
-----

[](#usage)

### Cache methods

[](#cache-methods)

```
$cache = \Bnomei\MySQLCache::singleton(); // or
$cache = dolphin();

$cache->set('key', 'value', $expireInMinutes);
$value = dolphin()->get('key', $default);

dolphin()->remove('key');
dolphin()->flush();
```

### Benchmark

[](#benchmark)

```
dolphin()->benchmark(1000);
```

```
mysql : 0.03287492121384
file : 0.11837792396545
```

> ATTENTION: This will create and remove a lot of cache files and SQLite entries

### No cache when debugging

[](#no-cache-when-debugging)

When Kirbys global debug config is set to `true` the complete plugin cache will be flushed and no caches will be read. But entries will be created.

### How to use MySQL Cache with Lapse or Boost

[](#how-to-use-mysql-cache-with-lapse-or-boost)

You need to set the cache driver for the [lapse plugin](https://github.com/bnomei/kirby3-lapse) to `mysql`.

**site/config/config.php**

```
