Slow panel due to fields with big queries

I have a site.yml with some tabs.

In one tab I have three relationship fields (Relationship field | Kirby CMS)
In two other tabs I have standard multiselect fields.

In everyone of those fields I need access to every page, because the editor might need to link to an internal page.

Example:

link:
  type: multiselect
  max: 1
  options: query
  required: true
  query:
    fetch: site.index
    value: {{ page.autoid }}
    text: {{ page.title }} - {{ page.uri }}

There are about 900 pages. The panel and the fields feel sluggish and the multiselect filtersearch doesn’t work all the time.

What would be the best way to improve the performance of those fields?

Thanks!

Since you are apparently using the AutoID plugin, maybe this?

…note the “Migration from AutoID” chapter in the Readme.

Thanks!

I was hoping there was something (caching maybe) I could do in Kirby to improve performance. But I might as well go the plugin route :slight_smile:

You could of course implement your own lightweight caching solution – calling a custom site method from your fetch statement which would return an index of pages that you can cache using Kirby’s plugin cache (plus a hook setup that flushes your cache when content is changed).

There’s actually a brilliantly detailed thread on caching, with this post particularly addressing the task you are looking at; that could contain some valuable ideas.

1 Like

I will check that out.
Thanks!

i posted my answer here.

I already posted it in the other thread, but if someone needs a solution: I found this to reduce the sluggishness: Multiselect | Kirby CMS

search:
  min: 3
  display: 10

bnomei’s caching solution will also be added in the near future, but this helps tremendously already.