Developers have had questions about how the release candidate of Next.js, which shipped last month, handles cache. Vercel’s Lee Robinson, vice president of product marketing, attempted to address those questions in a recent post about where Vercel intends to take cache and data in Next.js.
In the release candidate for Next.js 15, many parts are no longer cached by default, he wrote.
“In Next.js 15, if I make a fetch to some API, or make a database query, the result is not cached. This is something dynamic. If you want to cache the data, you can opt-in to this behavior. You need to be explicit.”
“We believe the local dev experience should be as ‘lazy’ as possible.” — Lee Robinson, Vercel’s VP of Product Marketing
First, he explained pre-rendering, which is different from caching data fetching or database queries, he wrote. It’s where the framework tries to generate a static HTML page during ‘next build.’” He then answers a series of related questions, such as why pre-rendering is functioning differently in local development than production.
“We believe the local dev experience should be as ‘lazy’ as possible. Pages should compile on demand; you wouldn’t want to wait for every single route to compile before you can get started,” he said. “Prerendering every route on save would be slow, which goes against our ambition to keep improving Fast Refresh times.”
Long story short: They’re adding an icon back that will let you know if the page will get pre-rendered.
In the long term, their goal is to make all async operations opt into dynamic rendering.
“We believe partial prerendering will become the default way of building Next.js applications. In this world, routes can be both static and dynamic,” Robinson wrote.
Then even if the majority of the app is dynamic, developers would still get a shell of the application in the browser immediately, and the dynamic parts would stream in parallel.
“If you want more of the route to be included in the prerender, you can wrap the dynamic parts of your page in React Suspense to define a fallback state,” he added. “Next.js can then prerender up to that Suspense boundary as part of the build process. When serving the page, the user is immediately shown the prerendered HTML while simultaneously streaming the dynamic parts of the route.”
He ended with a list of what this means for Next.js 15:
fetch requests are no longer cached by default;
Route Handlers are no longer cached by default;
Client-side navigations will no longer keep a cached version of the last page for 30 seconds when using <Link> or useRouter.
Rust + AI = More Money
Rust or Golang can increase pay by as much as $30,000 for a job related to artificial intelligence, according to research from content operations software StoryChief.io.
The company analyzed 12,643 job listings on Glassdoor that mentioned AI and displayed any salary information. It’s a bit convoluted as to how it arrived at the figures, but basically it identified the most common keywords related to skills, education and experience, and then estimated each keyword’s salary value, depending on which state the job is in and other criteria.
Under their calculations, Rust added a salary boost averaging $29,480, and Go added $21,080. Python would mean an additional $13,100 while PyTorch translated to $7,223. JavaScript added an average of $5,952.
Oddly, R — commonly used in data work — rated a negative $6,000, which does not mean it decreased the salary, but rather indicates that the language tended to have lower-than-average salaries, the company said.
A Look at Million.js, a Minimalistic JS Compiler
Million.js is an open source JavaScript compiler that takes a minimalistic approach. We haven’t seen a lot about it and creator Aiden Bai has not responded to our requests for an interview. But this week we found an in-depth review of Million.js by programmer and LogRocket technical writer Isaac Okoro.
“It lets you write JSX code like React, but compile your code so you ship a lot less JavaScript to the browser,” wrote Okoro. “Million uses a granular approach when updating the DOM. This works differently from how React handles DOM updates, where it updates the entire DOM tree. Million’s approach reduces memory usage, improves rendering speed and performance without sacrificing flexibility.”
Million.js achieves this by using blocks, which are lightweight and highly performant higher-order components “optimized for rendering speed that you can use as a React component,” he wrote.
Million.js boasts the following strengths, according to Okoro:
“Blazing” fast speed;
Low memory usage;
Easy DX;
Integration with React and React frameworks like Astro, Gatsby, Next.js;
Documentation.
However, Okoro cites the learning curve, lack of community and ecosystem, and questions about its future as drawbacks.
TRENDING STORIES
YOUTUBE.COM/THENEWSTACK
Tech moves fast, don't miss an episode. Subscribe to our YouTube channel to stream all our podcasts, interviews, demos, and more.
Loraine Lawson is a veteran technology reporter who has covered technology issues from data integration to security for 25 years. Before joining The New Stack, she served as the editor of the banking technology site Bank Automation News. She has...