3 ms·
I have some experience with static sites — my personal site was a static Markdown-generated site for about six years. The generator went through several iterati
by neongreen 4y ago
I have some experience with static sites — my personal site was a static Markdown-generated site for about six years. The generator went through several iterations, from a shell script to a Haskell app. My company site (also static) was generated with Haskell and later bits of it used Mustache. I've used a variety of hosts, too — GitHub Pages, Vercel, DigitalOcean.
None of those survived even a year without bitrot.
Sure, once the site was deployed it would work forever regardless of the platform. But this is true with Next.js and Vercel (what the OP is using) as well.
Once I wanted to modify the site and reupload it, something would always break. Incompatible dependency versions. The deploy manifest (for Vercel) doesn't work anymore. Something happened with Bash (I don't remember what exactly was the culprit). Nix doesn't work on my new machine and I specified the deps (imagemagick etc) with Nix because "then it'll never break". Etc.
At least with Next.js you get a bunch of nice stuff out of the box. A Next.js site should in theory be faster than a fully 100% static site. Next.js automatically prefetches links in viewport/on hover, makes sure images are only loaded when they are in the viewport, and inlines Google Font links. Vercel automatically distributes your static files over a CDN.
This is just my experience, but personally I have learned that if I want to make a static site, I will not avoid bitrot no matter what. So at least I might enjoy free CDN-enabled hosting & out-of-the-box performance tricks & a good templating language.
- alpaca128 4y ago> makes sure images are only loaded when they are in the viewport To be fair that can already be done in pure HTML with the `loading="lazy"` attribute. And browsers will probably do the link preloading as well sooner or later, some already do in specific cases. NextJS is nice but after all the issues with dependencies and npm I went through I'd hesitate to use it for personal projects.
- leerob 4y agoHey, could you share more about the issues you hit? Would be happy to take a look. Also FWIW the new version of the Next.js image component has been refactored onto native browser lazy loading. When it was first created, cross browser support wasn’t there so it had to polyfill support. Not only does it do lazy loading, but it also can optimize your images for you.
- satvikpendem 4y agoHey Lee, I actually have your personal site as one of my examples, hope that's alright. Do you know if Next has iframe lazy loading as well? I'm using `loading="lazy"` which works but didn't work as well as the package I'm using that's on the React side, react-lazy-load-image-component, which works for iframes as well, and it actually doesn't even mount the component until it comes into view, which didn't seem to be the case for `loading="lazy"`.
- kalleboo 4y agoI’ve been tasked with maintaining our online stuff (some websites, some backend API for our app, a basic admin page for in-app feedback) It was originally written in PHP over 10 years ago with bits and pieces added. Over the years it's gone between hosts, Linux distributions, and many PHP/Apache versions. I think it only broke due to a PHP depreciation once. So if you want longevity, I'd say PHP is the best option, even if you just use PHP to generate a static site.