Complete the code to import the Next.js cache debugging tool.
import { [1] } from 'next/cache';
The unstable_cache function is the official Next.js caching tool import.
Complete the code to wrap a function with Next.js cache debugging.
const cachedFunction = [1](() => { return fetch('/api/data'); });
The unstable_cache function wraps your function to enable caching.
Fix the error in the cache debugging function call.
const data = await unstable_cache(() => fetch('/api/data'), { [1]: 60 });
The correct option to set cache duration is revalidate in seconds.
Fill both blanks to create a cache key part and set revalidate time.
const cachedData = unstable_cache(fetchData, { keyParts: ["[1]"], revalidate: [2] });Use a descriptive string like 'user-data' as the key part and set revalidate to 60 seconds.
Fill all three blanks to define a cached fetch with keyParts, revalidate, and tags.
const cachedFetch = unstable_cache(fetchData, { keyParts: ["[1]"], revalidate: [2], tags: ["[3]"] });Use 'api-fetch' as the key part, set revalidate to 30 seconds, and use 'api-tag' as the tag.
