How to use plugin cache?

Hi there,

I’m trying to create a cache for my plugin but I don’t know how to make it work. I tried with the simple code below but updating a page doesn’t seem to create any cache file that I can use anywhere else.

<?php

Kirby::plugin('adrienpayet/front-comments', [
  'options' => [
    'cache' => true,
  ],
  'hooks' => [
    'page.update:after' => function ($newPage) {
        kirby()
            ->cache('adrienpayet.front-comments')
            ->set('foo', 'bar');
    }
  ]
]);

This code in a template doesn’t work either :

$kirby->cache('adrienpayet.front-comments')->set('foo', 'bar');
echo $kirby->cache('adrienpayet.front-comments')->get('foo');

It works again. I just had to remove and reinstall another plugin. Don’t know why.