Next.js is a fullstack React framework for the web, created and maintained by Vercel. Vercel's platform provides a native Next.js experience with enhanced support for all Next.js features.
While Next.js works when self-hosting, deploying to Vercel is zero-configuration and provides additional enhancements for scalability, availability, and performance globally.
Next.jsRead the guide
Incremental Static Regeneration (ISR) allows you to create or update content without redeploying your site. ISR has three main benefits for developers: better performance, improved security, and faster build times.
When self-hosting, (ISR) is limited to a single region workload. Statically generated pages are not distributed closer to visitors by default, without additional configuration or vendoring of a CDN. By default, self-hosted ISR does not persist generated pages to durable storage. Instead, these files are located in the Next.js cache (which expires).
In summary, using ISR with Next.js on Vercel:
Better performance with our global Edge Network
Server-Side Rendering (SSR) allows you to render pages dynamically on the server. This is useful for pages where the rendered data needs to be unique on every request. For example, checking authentication or looking at the location of an incoming request.
On Vercel, you can server-render Next.js applications in either the Node.js runtime (default) with Serverless Functions or the Edge runtime with Edge Functions. This allows you to pick the best rendering strategy on a per-page basis.
In summary, using SSR with Next.js on Vercel:
Zero-configuration support for
Cache-Control headers, including
Image Optimization helps you achieve faster page loads by reducing the size of images and using modern image formats.
When deploying to Vercel, images are automatically optimized on demand, keeping your build times fast increasing your page load performance and Core Web Vitals.
When self-hosting, Image Optimization uses the default Next.js server for optimization. This server manages the rendering of pages and serving of static assets.
In summary, using Image Optimization with Next.js on Vercel:
This also allows you to use all Google Fonts with performance and privacy in mind. CSS and font files are downloaded at build time and self-hosted with the rest of your static assets. No requests are sent to Google by the browser.
In summary, using Font Optimization with Next.js on Vercel:
To learn how to use
@next/font, see Optimizing Fonts on the Next.js Docs.
Dynamic social card images (using the Open Graph protocol) allow you to create a unique image for every page of your site. This is useful when sharing links on the web through social platforms or through text message.
@vercel/og image generation library allows you generate fast, dynamic social card images using Next.js API Routes.
On Vercel, your Next.js API Routes using Vercel OG are automatically optimized using Vercel Edge Functions and WebAssembly. This enables social card images to be generated faster, cheaper, and more scalable than self-hosted Next.js.
In summary, using Vercel OG with Next.js:
Middleware is code that executes before a request is processed. Because Middleware runs before the cache, it's an effective way of providing personalization to statically generated content.
When self-hosted, Middleware is limited to a single region workload. Middleware is not distributed closer to visitors by default, without additional configuration or vendoring of Edge compute. Since Middleware runs before every request, using Edge compute is a more efficient and performant way to serve content.
In summary, using Middleware with Next.js on Vercel:
Runs using Edge Middleware which are deployed globally
Vercel supports streaming for Serverless Functions, Edge Functions, and React Server Components in Next.js projects. Streaming data allows you to fetch information in chunks rather than all at once, speeding up Function responses. Using streams can improve your app's user experience and prevent your Serverless and Edge Functions from failing when fetching large files.
Check out our docs on Edge Function streaming.
When self-hosting, static assets are deployed to the single region Next.js server. Static assets are not distributed closer to visitors by default, without additional configuration or vendoring of a CDN.
On Vercel, static assets are replicated and deployed to every region in our global Edge Network. This ensures that static assets are served from the closest location to the visitor, improving performance and reducing latency.
For certain static assets (e.g. the
public folder in Next.js, these files are hashed and unique for each version of your application. They do not change. This means that Vercel can deploy them to every region around the world and cache them efficiently, including enabling zero-downtime rollouts.
In summary, using Static Assets with Next.js on Vercel:
When self-hosting, every request using Preview Mode hits the Next.js server, potentially incurring extra load or cost. Further, by spoofing the cookie, malicious users could attempt to gain access to your underlying Next.js server.
On Vercel, our Edge Network prevents invalid requests for Preview Mode automatically. If the preview cookie is invalid, our CDN responds and removes it. If the user is unauthenticated, you will not pay for any extra usage. Requests using Preview Mode are automatically routed to a Serverless Function instead of serving from the static cache.
In summary, using Preview Mode with Next.js on Vercel:
Next.js was built for collaboration. When deployed to Vercel, every Next.js Preview Deployment can be shared with your entire team for feedback.
Review and collaborate on your Next.js sites with comments, screenshots, notifications, and more – all synchronized with Slack.
Learn more about Comments.
Performance Analytics help you understand how your Next.js application is performing in the field. This helps you answer questions like: Does it load fast? Is it responsive? Is it visually stable?
When self-hosting, the
reportWebVitals hook allows you to send metrics to any analytics provider. However, this requires additional configuration and setup. On Vercel, Analytics enable real-time monitoring of Core Web Vitals with zero-configuration to your Next.js application.
Learn more about Vercel Analytics.
Vercel provides built-in observability for Enterprise customers with Monitoring. The Monitoring tab allows you to visualize, explore, and monitor your usage and traffic data with a powerful query editor.
Learn more about Monitoring on Vercel.
Next.js and Vercel integrate with your favorite tools, including:
- Remote Caching: When using Next.js in a monorepo, Vercel can decrease your build times by sharing the cache across your entire organization
- Automatic Edge Network Internationalized Routing: On your local device,
next devwill simulate the entire internationalization routing system for you. When deployed to Vercel, however, your Next.js application will take advantage of Vercel's globally distributed Edge Network for dynamically routing to the right Next.js page depending on the sub path or domain.
- Automatic Preview Deployments:
git pushand receive an instant URL to share with your team for feedback, with deep integration into your git workflow. Vercel supports creating any number of environments, including both branch-based and trunk-based workflows.
- Fastest Builds: By tracing the minimal number of assets during builds, we can ensure the fastest possible Next.js build times.
- Automatic Bundling: API Routes are automatically intelligently bundled into combined Functions, which helps reduce cold boots.
- Support for All Features: As the creators of Next.js, our native platform supports all Next.js features including: Environment Variables, API Routes, Edge API Routes, Dynamic Routes, Catch-All Routes, Rewrites, Redirects, Headers,
Vercel, the creators of Next.js, provide Enterprise features for collaborating on and deploying your Next.js applications, including:
Enhanced Security with Developer, Viewer, and Billing Roles
Enhanced Observability with Monitoring
Real-time Feedback with Comments
Integrations with your favorite tools
Contact us to learn more about how Vercel can help your team.
For more information on how to use Next.js with Vercel, see our guides:
- Deploying Next.js with Vercel
- How to Build a Fullstack App with Next.js, Prisma, and PostgreSQL
- How to Build a Multi-Tenant App with Custom Domains Using Next.js
- Integrating Next.js and Contentful for your Headless CMS
- Getting started with Next.js, TypeScript, and Stripe Checkout
- Add Auth to a Next.js Site with Magic.link
- How do I generate a “sitemap.xml” for my Next.js app on Vercel?
- Integrating Next.js and Contentful for your Headless CMS
- Building Ecommerce Sites with Next.js and Shopify
- Can I deploy a locally built Next.js app to Vercel?