Web Hosting Vuejs Applications
Vue is unlike traditional single-page applications (SPAs), which must be fully rendered on the client, in that it allows server-side rendering (SSR). With SSR, an application server converts HTML strings into interactive content which then can be “hydrated” with interactivity through browser interaction – improving Core Web Vital metrics like Largest Contentful Paint significantly. Several frameworks such as VitePress and Nuxt from the Vue team as well as third party static site generators like Quasar and Astro support SSR as well.
SSR makes it essential to avoid mismatches between server-rendered HTML and client state on both ends. Such mismatches can lead to performance problems and even crashes, so avoiding them whenever possible should be prioritized. You can do this by eliminating dependencies not used by clients, using v-if + onMounted to only render parts not necessary on clients and making sure all random values generated both ways are identical (using identical seeds etc).
If you are deploying your Vue application to a CDN such as GitLab Pages, it is recommended that an SSR build tool manage the build step and integrates seamlessly with the backend framework of choice. Vite provides an SSR plugin that will produce production-ready builds of your application within its./dist directory — please see Production Deployment Guide for further details.