dreamland
SPA w/ SEO or SSG + nitro?
well as only 1 of the options has no ❌ blockers, i chose:
prerender SSR all pages with
<ClientOnly>
in "SPA" pages + custom loading screen
this allows custom SEO meta tags per route and control over static initial html size
static small size initial html for "SPA" pages
static large size initial html for static pages40 replies
SPA w/ SEO or SSG + nitro?
i'll try to break it down by what my goal is and by what i gathered about the features that are offered by the different approaches
my goal
SPA part of the site
🎯 static small size initial html (to show something as soon as possible)
🎯 loading indicator (this is not really a goal, more like a necessary evil to show something as soon as possible)
🎯 api (nitro)
🎯 meta tags for "/" route
static part of the site
🎯 static initial html
🎯 custom meta tags per route
approaches
SPA
✔️ static small size initial html
✔️ loading indicator (~/app/spa-loading-template.html)
✔️ api (nitro)
✔️ meta tags for "/" route
❌ custom meta tags per route
SSG
✔️ static initial html
✔️ custom meta tags per route
❌ api (nitro) (?)
dynamic SSR
❌ static initial html (to show something as soon as possible)
✔️ custom meta tags per route
✔️ api (nitro)
➖ SSR performance paranoia (currently 60k users, aiming for millions very soon)
➖ SSR feels like losing ownership over network traffic
prerender SSR
✔️ static initial html with control over size through
ClientOnly
➖ needs custom loading indicator
✔️ custom meta tags per route
✔️ api (nitro)
as you can see the downsides of dynamic SSR are more subjective than objective
for a side project dynamic SSR would be just fine, but for this project i prefer to eliminate uncertainties40 replies
SPA w/ SEO or SSG + nitro?
i also have a custom loading indicator.. i'd like to use the default
~/app/spa-loading-template.html
but unforunately that is only available when using ssr: false
, which is not what i want, because.. well you know what happens, it's not SSR-ed, hence no custom meta tags on the routes40 replies
SPA w/ SEO or SSG + nitro?
the benefit of prerendering is that pages can have their one meta tags for search engine results
essentials i have a SPA part and a static part
/ (SPA)
/somePage (frontend routed)
/help/someTopic (static with custom meta tags)
40 replies
SPA w/ SEO or SSG + nitro?
i think there is a misunderstanding.
you were talking about
nuxt generate
(aka SSG), and i was asking about serving the SSG static output along with running the nitro server
do you mean setting prerender routes on a per route basis? i want all routes to be prerendered. nuxi build --prerender
seem more appropriate in that case, but that is experimental https://nuxt.com/docs/api/commands/build
i feel like i'm trying to achieve a very basic usecase, but it feels like i'm fighting nuxt to do something it's not supposed to40 replies