strapi-plugin-sitemap
strapi-plugin-sitemap copied to clipboard
Surgical URL injection / Caching
Feature request
Summary
When you have the autoGenerate
setting enabled and you update a piece of content, all the pages that should be included in the sitemap are queried and afterwards added to the sitemap. If you have a larger sitemap is could be a big performance issue.
Why is it needed?
It is probably best to only update the URL of the page you have just created, edited or deleted. So only that page will be queried. We can do this by implementing some kind of caching layer.
Suggested solution(s)
Solution 1:
Create a urls.json
file in which you store al the URLs of the sitemap.
You could surgically add, edit or remove URLs from this file and afterwards regenerate the sitemap.xml based on that JSON file.
Solution 2: Instead of having an extra JSON file that holds the URLs, we could (maby) also just read the URLs from the sitemap.xml file itself and use those to then again regenerate the sitemap.