Sorry, we don't support your browser.  Install a modern browser
This post is closed.

add cache remember function#391


for kirbys base cache class a function called remember could be added that makes the common usecase of only fetching a value from cache if its null easier. this is done using a simple closure.

in laravel

basically thats the main idea for my lapse plugin as well (with some more magic for the key generator).

$data = lapse(crc32($page->url()), function () use ($kirby, $site, $page) {
    // create some data
    return [
        'author' => site()->author(),
        'title' => $page->title(),
        'text' => $page->text()->kirbytext(),
        'url' => $page->url(),
  • bnomei
2 years ago
10 months ago
Changed the status to
10 months ago