I'm currently building a sitemap for my web app.
Note: my app is a single page app built with React and Firebase.
Basically I wan to index blogPost
and product
pages. So I intend to generate my sitemap dynamically (on server). It's a small website (around 500 pages).
I want to build something like this:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>
https://www.myproject.org/blog/some-blog-post-slug
</loc>
<lastmod>2019-11-14T20:22:43.502+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>
https://www.myproject.org/dp/some-product-slug
</loc>
<lastmod>2019-11-15T13:08:52.127+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
And I keep the following properties in my database, both for blogPosts
and products
:
createdAt: <Timestamp>
lastModifiedAt: <Timestamp> // UPDATED EVERYTIME I UPDATE THE RECORD
And I'm thinking about using my lastModifiedAt
value as the <lastmod>
tag for the sitemap.
So far, so good! Everytime I update my blogPost
or product
objects in my database. The next time the sitemap is requested, the new modifiedDate
will show on those that have been changed.
QUESTION
But what if I make a change not in the database itself, but in the way I render all the product
pages, for example.
Imagine that I've added some structured data tags to display rich results on google, with price, reviews etc. So my product info is the same, but from that point on, all of my product pages will render those extra tags that I need to be re-indexed.
Example (add a structured data tag with the product price):
<div property="schema:price" content="119.99"></div>
In that situation, will I have to update all <lastmod>
for all the products? How Google will know that it needs to re-crawl those pages and be able to see the structured data tags?
What if I change only the styles for the productPages
? Do I have to update the <lastmod>
for every product in this case?