Skip to content
Dashboard

Introducing the Runtime Cache API

import { getCache } from "@vercel/functions";
export async function GET(request) {
const cache = getCache();
const cacheKey = 'blog';
const value = await cache.get(cacheKey);
if (value) {
return value;
}
const res = await fetch("https://api.vercel.app/blog");
const originValue = await res.json();
await cache.set(cacheKey, originValue, {
ttl: 3600,
tags: ['blogs'],
});
return originValue;
}

The Vercel Data Cache, used by unstable_cache() and fetch() caching in Next.js 13, remains in beta and is not billed during this period.

You can still view your Vercel Data Cache usage under the Runtime Cache tab via the toggle at the top of the page.