-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sitemap cache not working with getkirby/staticache plugin #39
Comments
ah the cache needs an expire if it will not be flushed with the pages cache. but i think thats an okayish compromise. $cache->set($cacheKey, [
'html' => $sitemap,
], option('cache.pages.type') !== 'static' ? 0 : 15); |
@bnomei Thanks for your research an the decvelopment of a solution. But I am hesitating to incorporate this solution since it makes everything more fragile and would make it dependant on one specific other plugin. I’d really prefer, if the staticache plugin would offer a solution that also works with "virtual" pages. Could the caching issue maybe resolved by using hooks that listen to events like |
yes you could just flush your plugins custom cache on each page updated hook. no performance drawbacks with that. |
added a comment to the commit for error in |
Would be great to get confirmation on this .. is everything working as expected? 😉 |
it does. i have dev branches of both staticache and meta running side by side successfully. |
As far as I am aware, the only thing that does not work correctly at the moment is when the |
Thanks guys! I've got trouble right now getting |
1.) key should not contain a dot since the staticache uses that instead of
/
https://github.com/getkirby/staticache/blob/9ef2d7195b5c8212fcf53194407cc28aec0e3901/src/StatiCache.php#L144
2.) i think the data set should not be a string but an array.
https://github.com/getkirby/kirby/blob/9ecd11cd5b7d4875d4212f767a2b3ad3e52b3528/src/Cms/Page.php#L1030
BUT the staticache plugin expects a real page object (cache key => page id) so it will all fail anyway
https://github.com/getkirby/staticache/blob/9ef2d7195b5c8212fcf53194407cc28aec0e3901/src/StatiCache.php#L106
how to fix this? add a plugin cache and check for staticache plugin but match array for pages cache just to be safe
The text was updated successfully, but these errors were encountered: