14 ms·
Sometimes I feel like work and needless infra complexity grows perfectly to match headcount and nominally available resources.
by 0x3f 10mo ago
Sometimes I feel like work and needless infra complexity grows perfectly to match headcount and nominally available resources.
- amichal 10mo agoI feel the same, 72 million monthly page views is about 8 pages per second even if in a single timezone (72e6 / 8h * 30d * 3600h/s) - even with today's heavy weight pages we are talking under well under 1000 req/s. Assuming they are not super image/asset heavy i would expect this to comfortably be served by a couple of reasonable old school ngnix servers[1]. If each page was a full megabyte of uncached content we are < 10Gbits/sec. Probably under 1 The build logic to decide which things to rebuild of course is probably the interesting bits but we dont need all these services... </grey-beard-rant> [1] https://openbenchmarking.org/test/pts/nginx&eval=c18b8feaeca6235b318667a0c1159c7eb54ce634#metrics https://openbenchmarking.org/test/pts/nginx&eval=c18b8feaeca... edit: to be less ranty they are more or less building static sites out of their Next.js codebase but on-demand updated etc which is indeed interesting but none of this needs cloudflare/hyerscaler tech Not sure how many customers/sites they have. Perhaps they don't want to spend CPU regenerating all sites on every deployment? They do describe a content-driven pre-warmer but I'm still unclear why this couldn't be a content-driven static site generator running on some build machine
- 0x3f 10mo agoThe thing is you can still stick a CDN in front of your old school servers and just use a 'stale-while-revalidate' header to get exactly the effect described here.
- amichal 10mo agothis too...
- cloudflare728 10mo agoI have done this with Next.js. Next.js doesn't support this header or I don't know how. I already had HAProxy setup. So I have added stale while revalidate compatible header from HAProxy. Cloudflare handle the rest. Edit: I am not using vercel. Self hosted using docker on EC2.
- 0x3f 10mo agoWell, part of the Vercel game is to lock you in to their platform and extract $$$, but as I recall you can spec out headers in NextJS config?. And possibly on CloudFlare itself via cache rules?
- cloudflare728 10mo agoI am self hosting using Docker. Next.js config to change header didn't work for me. I had cache rules in Cloudflare, but Next.js header for page (no-cache) doesn't allow Cloudflare to apply stale-while-revalidate. Now that I have proper header added by HAProxy, Cloudflare cache rules for stale-while-revalidate works. If anyone can reach Cloudflare. Please let us forcefully use stale-while-revalidate even when upstream server tells otherwise.
- amichal 10mo agoYeah, as a salty greybeard i tried to tell our FE tech-lead to just render the proper HTTP Cache-Control headers in the Next.js site we recently built. He tried and then linked me to https://nextjs.org/docs/app/guides/caching https://nextjs.org/docs/app/guides/caching and various version of their docs on when you can and cannot set Cache-Control headers (e.g. https://nextjs.org/docs/app/api-reference/config/next-config-js/headers#cache-control https://nextjs.org/docs/app/api-reference/config/next-config...) and I got several hours of head-ache before calling it a problem for another day. That site is not high traffic enough to care but this is not the first time that i've gotten the "not the Next.js way" talk and was not happy. I obviously can be done but clearly is not the intended solution which really bothers me
- SkiFire13 10mo agoWe do this, but if you're redeploying fast enough thre's a change that a user loads a cached old page (or performs a client-side navigation to an old page) and makes a requests for a URL that's no longer served by the origin nor is cached by the CDN.
- skeptrune 10mo agoStale-while-revalidate as implemented in the post was easier for us and required less resources than migrating from our dynamic site architecture to static. Ideally we would have migrated to fully static sites, but the engineering effort required to make that happen wasn't in scope.
- 9rx 10mo agoSomething I noticed a long time ago is that Vercel turns everything they touch into being 10 times harder than it needs to be. I have come to conclude it is that way because they focus on optimizing for a demo case that presents well to non-technical stakeholders. Doing one particular thing that looks good at a glance gets the buy-in, and then those who bought in never have to deal with the consequences of the decision once it is time to build something other than the demo.
- skeptrune 10mo agoI blame this more on NextJS than Vercel, but agree in spirit. Their architecture creates a pit of failure where you're encouraged to fall into a fully dynamic pattern and is a huge trap. However, it's probably more inexperience than anything. Nobody senior was around to tell our founders that they should go for a SSG architecture when they started /shrug. It's mostly worked out anyways though haha.
- 0x3f 10mo agoI'm no fan of Vercel, but it's kind of the symptom of a wider pattern, right? I see crazy architecture astronaut setups in so many places. It's true non-technical stakeholders can cause problems but I often see it pushed from inside the tech org too. I'm thinking it's some combination of resume-driven development, misunderstanding of 'scalability'/when it's needed, and intra-org working-together problems where it's easier to just make a new service and assert your dominion over it.
- immibis 10mo agoIf true, it's one of the only things preventing totls economic collapse due to lack of jobs.
- 0x3f 10mo agoI would suggest that UBI in fact already exists, just in a subset of tech jobs where you have to engage in a certain kind of theater to get it. It's only by construction though that losing these jobs would be a problem. We have pointless busywork (and a ton of other problems) because housing is a failed market, essentially.