topherlicious
Understanding best practices for SSR + CMS setups
Just to update for anyone that finds this later: The pattern I'm looking for is not a thing in Nuxt. If you want to force SSR for every page, you need to use SSG instead. I find it a bit odd that there's no standard accepted way to accomplish this, but I guess that just isn't Nuxt's thing.
Instead, the pattern is to make an internal server route that then uses your API key to make another external request.
More info and a solid example found here:
https://github.com/nuxt/nuxt/discussions/20544#discussioncomment-5741868
19 replies
Understanding best practices for SSR + CMS setups
Just to think out loud, I can just allow requests to happen client side and use a whitelist on my CMS server. That would solve my concerns here. But I still really want to know the proper way to do this, I can't be the first person to want to accomplish something like this. I wonder if it's just something that isn't suited for the Nuxt way of doing things.
19 replies
Understanding best practices for SSR + CMS setups
Fair question, and SSG is what I'm used to. This website is going to have a blog managed by multiple users, and using Nuxt file-based SSG is not going to be a good choice in the long run I think.
19 replies
Understanding best practices for SSR + CMS setups
Thanks for the response. I mentioned in my first message that I am purposefully avoiding using the Nuxt Strapi module altogether. I would also just like to understand how this works without it. Strapi is not the only CMS out there, and I assume it MUST be possible to achieve what I'm looking to do... I have read the documentation that you have linked in pretty good detail but I'm still not understanding how to achieve my specific use case. This seems like it would be a common issue to solve with SSR. Make a fetch on the server, and then render the result. Unless I am just fundamentally misunderstanding how these things are built, that doesn't seem like an unusual setup?
19 replies
Understanding best practices for SSR + CMS setups
After some experimentation, it looks like this might accomplish what I'm after?
But this does not seem like the right way to do this at all. Editing to say that this method indeed does not work during client navigation, but only on a full page load on this page specifically.
19 replies