var cachePolicy = isGoogleBot
? new CacheEvictionPolicy(TimeSpan.Zero,
CacheTimeoutType.Sliding,
new[] { _contentCacheKeyCreator.VersionKey })
: null;
CacheManager.Insert(cacheKey, sitemapData.Data, cachePolicy);
I think it would be reasonable to cache it for some limited period - maybe 1 day or maybe 1 day by default with an option to overwrite this value in configuration?
With the following values in the configuration:
sitemap data is being cached forever due to the fact that the CacheEvictionPolicy is set to null (if I'm not a googleBot):
https://github.com/Geta/geta-optimizely-sitemaps/blob/master/src/Geta.Optimizely.Sitemaps/Controllers/GetaSitemapController.cs#L109
I think it would be reasonable to cache it for some limited period - maybe 1 day or maybe 1 day by default with an option to overwrite this value in configuration?