# Remember this - Caching in Kirby

**URL:** <https://forum.getkirby.com/t/remember-this-caching-in-kirby/23705>\
**Category:** Solutions\
**Tags:** v3\
**Created:** [October 18, 2021, 9:30pm UTC](https://forum.getkirby.com/t/remember-this-caching-in-kirby/23705 "2021-10-18T21:30:22Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![stffr](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@stffr](https://forum.getkirby.com/u/stffr)\
**Post date:** [June 9, 2022, 12:49pm UTC](https://forum.getkirby.com/t/remember-this-caching-in-kirby/23705/8 "2022-06-09T12:49:11Z")

</div>

> [@bnomei](#):
>
> ```auto
> <?php
> 
> class PagesThatCanBeReferenced
> {
> static $cache = null;
> static function load(): ?\Kirby\Cms\Pages
> {
> // if cached then return that
> if(static::$cache) return static::$cache;
> 
> $collection = site()->index(true)->filterBy('intendedTemplate', 'in', [
> 'person',
> 'organisation',
> 'document',
> 'place'
> ]);
> 
> static::$cache = $collection;
> return static::$cache;
> }
> }
> 
> return function () {
> return PagesThatCanBeReferenced::load();
> };
> 
> ```

Hi bnomei, thanks for all your information!

I have a question about your snippet for a static cache for a collection of pages for multiselect (exactly what my panel is slowed down by tremendously, see [Slow panel due to fields with big queries](https://forum.getkirby.com/t/slow-panel-due-to-fields-with-big-queries/25583))

Should the snippet above work _without_ your boost plugin or is that required? Because I tailored it to my case (without the intendedTemplate filter), activated the cache in the kirby config but it didn’t change anything?!

Thanks for your help.

---

_[View the full topic](https://forum.getkirby.com/t/remember-this-caching-in-kirby/23705)._
