Hey folks! I've recently started my web development journey after coming from a background in low-level game development. I wanted to create a website to showcase my projects and games and kicked things off using 'npm create vite@latest'. Everything was going smoothly for a while as I experimented with small projects. Eventually, I learned about frameworks like Next.js and concepts like Single Page Applications (SPAs) and Static Site Generation (SSG).
However, I've realized that my SPA might be slowing me down. After diving into backend development and creating numerous pages, I noticed my site's load times were around a second—a fact I initially brushed off as a connection issue. Recently, I wanted to explore Server-Side Rendering (SSR) but discovered that my current SPA setup wouldn't support it. Now I'm contemplating what to do next. I'm hesitant to rewrite my whole app in Next.js, and although I've considered using Astro, I'm uncertain if it would resolve my speed problem. Should I just accept the slow load times, try out Astro, or transition to Next.js while I still can? Any advice would be greatly appreciated! Also, I forgot to mention that I used React.
3 Answers
Definitely give Astro a shot! If you didn’t specify a framework while using vite@latest, you could easily integrate it. Since Astro is great for static sites, it might be the right fit for your needs, especially since your website is more of a personal project without heavy interactivity at the moment.
Have you checked the SSR section in the Vite docs? It might give you some insights into how to optimize your current setup without needing to switch frameworks entirely. Here's a link: [vite.dev/guide/ssr.html](https://vite.dev/guide/ssr.html).
I haven't looked yet, but I will! Thanks for the tip!
So, when you say ‘ticking time bomb,’ it sounds like you're worried about how your site will handle growth? Since you mentioned the load times, it could be due to the way your app is structured. Make sure you’re not loading everything up front—try splitting your code on routes using lazy loading. It won’t help with SEO, but it'll definitely speed things up!
That's a great point! Would lazy loading mean the content only loads when it's needed?
I'll look into Astro—sounds promising! I’m curious if it can handle more interactive content as my projects grow.