We're excited to release one of our most requested features with Next.js 12.1:
Update today by running npm i next@latest .
Next.js now exposes a function unstable_revalidate() allowing you to revalidate individual pages that use getStaticProps . This was one of our most requested features since we introduced Incremental Static Regeneration (ISR) in Next.js 9.5.
Since ISR was released, we've seen companies like Tripadvisor , Parachute , HashiCorp, and more drastically improve their build times while retaining incredible performance. However, we've heard your feedback on interval-based revalidations and are excited to provide more flexibility.
Currently, if you set a revalidate time of 60 , all visitors will see the same generated version of your site for one minute.
This is an excerpt. The full article is published by Next.js Blog.
Answers to common questions regarding this article's topic, architecture, and practical applications.
We're excited to release one of our most requested features with Next.js 12.1:
How It Works
The built-in Image Optimization API has been updated to support the same pattern as ISR pages, where images are served stale and revalidate in the background (also known as stale-while-revalidate). This is a significant performance improvement for optimizing images. See Image Caching Behavior to learn more.
General
Next.js now exposes a function unstable_revalidate() allowing you to revalidate individual pages that use getStaticProps. This was one of our most requested features since we introduced Incremental Static Regeneration (ISR) in Next.js 9.5. Since ISR was released, we've seen companies like Tripadvisor, Parachute, HashiCorp, and more drastically improve their build times while retaining incredible performance. However, we've heard your feedback on
General
We want to make every Next.js application build faster for production and get instant feedback in local development. Next.js 12 introduced a new Rust-based compiler that takes advantage of native compilation. With 12.1, we've added support to the Next.js Compiler for: With the above six transforms added, we have now ported the most common Babel plugins to Rust using the new compiler. If there are other plugins you'd like to see, let us know on th
General
With Next.js 12, we introduced minification using SWC as part of the Next.js Compiler. Early results showed it was 7x faster than Terser. Minification with SWC is now in Release Candidate (RC) with 12.1 and will become the default in 12.2. You can opt-in to using SWC for minification in next.config.js: module.exports = {
swcMinify: true,
};
Let us know your feedback on the discussion.