cache name with major version
bnomei opened this issue · 1 comments
bnomei commented
when implementing a cache consider giving the file a name including the major version of your plugin. this will allow you to devalidate the cache on major version changes automatically.
$cachename = 'sitemap-' . kirby()->plugin('omz13/kirby3-xmlsitemap')->version()[0];
kirby->cache('omz13.kirby3-xmlsitemap')->set($cachename, $sitemapString);
omz13 commented
In 0.4, I have implemented caching using the plugin cache facility (see the Cache Concepts document on notion)... the namespace is set automatically by kirby (so perhaps kirby should include the plugins version number)... but, just in case, I prefix a few parameters to the name when saving the page to the cache... in the next version I will add a bit more - to effectively cache bust vis-à-vis the options...
kirby3-xmlsitemap/src/xmlsitemap.php
Lines 111 to 116 in 757b413