SSG gives you the best SEO because web crawlers can understand the structure of a static page with pre-populated content better than a dynamic site that relies on Javascript. The pages also load much quicker and score better on other metrics that Google uses. I would go so far as to say that SSG is a must for major publications or anyone serious about SEO. This sort of data-driven SSG is exactly what you are thinking of but it happens at build time so that the build output is static content that can be put behind a CDN.