Vercel recently launched Vercel KV, a serverless durable Redis store. We've partnered with the Nuxt team to add support for integrating Vercel KV into Nitro, making fast key-value storage available for your Nuxt apps.
In a few lines of configuration, you can now set up a cache with durable storage for your Nuxt application:
nuxt.config.ts
exportdefaultdefineNuxtConfig({
nitro:{
storage:{
data:{ driver:'vercelKV'}
}
}
})
Nuxt automatically reads the KV_REST_API_URL and KV_REST_API_TOKEN environment variables for your KV database. Then, you can easily store data in any event handler:
Nuxt developers want to choose the best rendering strategy for a given page. With the Nitro 2.4 release, they can now pick between fully static, fully dynamic, or incrementally updated routes with powerful route rules.
nuxt.config.js
exportdefaultdefineNuxtConfig({
routeRules:{
// all routes will be background revalidated (ISR) at most every 60 seconds
'/**':{ isr:60},
// this page will be generated on demand and cached permanently
'/static':{ isr:true}
},
});
Nuxt's route rules enable you to opt different routes into the optimal rendering strategy.
View a demo of ISR with Nuxt to try out route rules.
We love working with Vercel. They share our values of great DX, zero-configuration and best practices built-in. I'm also really pleased to see the new offerings Vercel have been launching this week. I'm confident they will make Nuxt users' lives easier and better.
Daniel Roe
We're excited about our continual sponsorship of the framework and investment into supporting the latest Nuxt features on Vercel.
With Vercel's powerful tools and performance enhancements, Nuxt continues to be a leading choice for web developers looking to build modern, serverless applications.