Hacker News new | ask | show | jobs
by midway 2684 days ago
> Next.js [...] loads a little faster

IDK, my dockerized express site loads much faster. At 20ms without network time (and this w/o caching). My real React SPA give you instant (0ms) page loads.

Nextjs.org initial load is at 580ms and the doc came at whopping 1.38sec (oh yeah) and page loads are not instantly... this thing doesn't make sense (for my use cases). If the only thing I know is React and JSX, then maybe but routing with express is much easier.

=> you want make serious money with SEO => get some real SSR environment

=> you want a great SPA, buttersmooth, interactive, maintainable code => React or other popular SPA libs

2 comments

How can that be possible? The DNS lookup takes longer than that and you still haven't even gotten to your site. Once there the first byte time from the initial HTTP round strip still take considerably more. This is all network traffic that does matter what the application is doing.
> How can that be possible? The DNS lookup takes longer than that and you still haven't even gotten to your site.

I wrote without networking time which includes DNS lookup

How long is the first page load of your react SPA?
This is the wrong question. I use React for SPA use cases and then initial loading time is secondary but I tell you something, my stock React SPA with tons of js and assets has following loading times:

  DOMContentLoad: 1.08sec, Load: 2.26sec
and let's look at nextjs.org:

  DOMContentLoad: 1.09sec, Load: 2.31sec
I mean this comparison doesn't make sense because you don't know my SPA and I could write anything here but test it yourself. I just don't see a clear use case for Next.js. Just make an example, you sell some SaaS. Make the web product as React SPA but the marketing landing pages as normal express/pug site. Both the web product and the landing pages have different use cases: one needs to create leads and the other one has to increase customer satisfaction. These are different goals, so maybe you should also use different tools.
My own react app, not using next with a rather heavy payload (async splitting in webpack broke in the past 3 months and haven't been able to get it working again) is under a load of 1.24s Finished time, locally (static content server, with 2 db queries via api).

Unless you MUST have the absolute best SEO, I'm not sure that it really matters having SSR for most people/apps. I don't know how much traffic is really driven from search engines depending on the site, and I really don't know how much you get penalized for having an SPA anymore. I mean if your initial load is under 2-3s and in-site navigation is fast, you'll probably be fine.

The past few sites/apps I've consulted on got the majority of their traffic from outside SEO.

DOMContentLoaded isn't as relevant with SSR, because the markup and styles come rendered on the first response, so you never see an initial blank white page.

More relevant metrics are TTFB (time to first byte) and TTI (time to interactive).

I wouldn't want to implement a marketing site in express/pug. I want the flexibility of components and all the other benefits that React offers.

> How can that be possible? The DNS lookup takes longer than that and you still haven't even gotten to your site.

Me too. But if you ever did marketing landing pages for products you might know that one landing page is not enough. You need thousands which match to Ad Word campaigns or which are optimized to different SEO fields, domains and whatever. While you still could manage this with Next and nice components, Next's subpar routing might be an obstacle.