Open tomasz-jankowski-tj opened 2 years ago
Looking at the code and it works the same as before. It is refactored so that it is easier to understand and that's all.
SitemapData()
does go through all pages and generate a sitemap in real time still, right? Only difference seems to be that RealtimeSitemapData()
does not persist to database after generating.
It seems so. RealtimeSitemapData also caches results in memory if caching is enabled. I am not sure why something like this was made, but there is a task to improve this: https://github.com/Geta/geta-optimizely-sitemaps/issues/39 Although, I do not have time for it.
Hi,
This issue introduces significate performance issues. The sitemap that was created by the scheduled job is completely ignored and regenerated each time the sitemap is accessed, no matter if the EnableRealtimeSitemap setting is used or not. Here's how it looks now https://www.screencast.com/t/Cs2PLrZX85f vs how it used to be in Opti 11 https://github.com/Geta/SEO.Sitemaps/blob/master/src/Geta.SEO.Sitemaps/Controllers/GetaSitemapController.cs
notice the return new FileContentResult(sitemapData.Data, "text/xml; charset=utf-8");
in Opti 11 which makes use of what was previously generated by the Scheduled Job.
This can be fixed by replacing line 60 here: https://github.com/Geta/geta-optimizely-sitemaps/blob/master/src/Geta.Optimizely.Sitemaps/Controllers/GetaSitemapController.cs
with return FileContentResult(sitemapData);
Looks like there's already a PR for this ? #74
Sitemap file is generated each request instead of using file generated by scheduled job and stored in database.
How it looked for Epi 11
How it looks in EPI 12: