4 ms·
I'd love if someone could point me in the direction of WHY this Next.js setup "just works". This was a great article, and the author described the sensation of
by l00sed 6y ago
I'd love if someone could point me in the direction of WHY this Next.js setup "just works". This was a great article, and the author described the sensation of getting traffic very well. I've been on the other side of the coin where my apache server crashed or 50* error'd out. It would be interesting to know more about what makes this stack or this server architecture "just work" under the hug of death.
- quicksnap 6y agoI've been working with Next for a couple of weeks, here's my take: - Next.js aims for "pit of success" in building sites with React that are optimized for CDNs and small builds - Deploying said sites to Vercel takes advantage of the CDNs, so most of the users are getting cached data. So, for this site, I would assume: - There is no backend - All the HTML is cached and contains a static generation of the page(s) - The javascript is also cached - Vercel CDN is fast. That's it!
- tomglynch 6y agoWould it being cached mean that when the ship became unstuck, and the website changed from 'Yes' to 'Sort Of' or to 'No', that people who were checking back would receive an incorrect cached version?
- noahtallen 6y agoThe new copy is pushed to the CDN pretty quickly. I don’t know much about vercel. But the benefit of CDNs is that there is a 1:N relationship between you and the edge servers, and then an N:M relationship from the edge servers to the users. So there are a lot more servers much closer to people using your site. Pushing a new copy from “you” to each edge server is pretty straightforward. I imagine Vercel does it pretty quickly, but sometimes the edge server could poll for changes maybe once a minute, which is pretty cheap to do.
- gherkinnn 6y agoAdding to quicksnap's points: - Next.js makes it dead-easy to statically generate your pages using various strategies. And static pages take few resources to serve. [0] - It also gives you lots of info on bundle sizes, performance, and provides you with the tools to manage these. - Vercel is optimised to serve these static pages on their CDN. [1] And your project quite literally a single terminal command away from being live. - Both are very easy to get started with and a joy to use. - I am in no way affiliated with Vercel. I just like their products. [0] https://nextjs.org/docs/basic-features/data-fetching https://nextjs.org/docs/basic-features/data-fetching [1] https://vercel.com/docs/edge-network/overview https://vercel.com/docs/edge-network/overview
- dopeboy 6y agoI'm very new to it and one thing I really like about building in it is that there is no react-router. It bakes in routing and I've found that to be such a more pleasant experience than chasing around how react-router has changed.