How does one continually update a sitemap for highly dynamic sites, without rebuild / deploy?
For my stuff which is on AWS etc, obviously its just a matter of regenerating the XML file on demand, but I’m afraid I see no way to update only a sitemap on Netlify.
So what are the possibilities? How have people tackled this?
@zehawki I don’t know that there is a way to do this. When you create new content, it has to go through the build process to be accessible to visitors. That’s when you would (re-)create the sitemap file. Without new content, there shouldn’t be a need to re-create the sitemap file.
What am I missing?
Nothing can be further from the truth
Content has nothing to do with the code. The build is for the code. Once a code has been deployed, I can keep publishing content till the cows come home.
Thats what I asked… when there’s new content, how do I generate the sitemap.
@zehawki Perhaps you could walk me through your process for adding content to your Netlify site without doing a build?
Apologies I dont understand what you are asking. Most of the internet works the same way - publisher sites, blog posts, social media and so on. If one had to build to add content, the internet as we know it would stop working.
Also please pardon me in advance for not taking this discussion with you any further. Cheers.
Hi, @zehawki. I’ll mark this post as answered but I do want to follow-up with this:
- There is no way to update only a single file at Netlify.
There are three ways to deploy at Netlify:
- Drag and drop
- Netlify CLI manual deploys
- Git backed continuous deployment
(Technically, you can also make API calls directly which is a fourth method to deploy.)
All methods (including the API) require that all site content is included in the deploy (meaning every deploy needs to define all the files included).
If you want to update your sitemap, you still need to define the new version of the site by specifically stating which files are in the newest deploy. Previously uploaded files do not need to be sent again but they still need to be listed to the API when deploying (which is automatically done with the three methods listed above).
For example, let’s say you are using Netlify CLI to upload a new deploy of your site. The deploy references a directory in your local filesystem and all files in that directory or its in subdirectories will become part of the deploy. However, if you have previously upload all the files before and only changed one of them, the following happens:
- The Netlify CLI tool sends a list of all file names, paths, and checksums to the deploy API endpoint.
- The API returns a list of “required” files - which are files which have checksums which have never been seen before for this site in any previous deploy. The API will ask only for the new or changed file as it has copies of all the other already.
- The Netlify CLI tool sends only the files which have changed.
So, you are only required to send the files that change. Yes, the API still needs a full list of all files which should be included to define the deploy itself.
Please let us know there are other questions or if more information about this would be helpful.