pecotamic / sitemap

Sitemap for Statamic v3
6 stars 9 forks source link

Unable to cache config because of this Addon #12

Closed Rkallenkoot closed 3 years ago

Rkallenkoot commented 3 years ago

Because of the filter config in this addon, we're unable to cache the config. Any idea's if there's another way to get the functionality without using a closure in configs?

werner-freytag commented 3 years ago

If you don't need the filter callback, you can simply set it to null:

...

'filter' => null,

...

If you need a filter, you can provide it in every way, PHP allows to provide a callable, for example

...

'filter' => 'my_filter_func',

...

Just out of interest: How and why do you cache the config?

heidkaemper commented 3 years ago

We do config caching, too. To gain a little bit performance: https://laravel.com/docs/8.x/configuration#configuration-caching

Would be great if the filter and properties settings were set to null by default.

werner-freytag commented 3 years ago

I've changed the default value now.