Complete the code to fetch data with caching disabled.
const res = await fetch('/api/data', { cache: '[1]' });
Using 'no-store' disables caching and always fetches fresh data.
Complete the code to fetch data with caching enabled and revalidation after 60 seconds.
const res = await fetch('/api/data', { cache: 'force-cache', next: { revalidate: [1] } });
Setting revalidate: 60 means the cached data is fresh for 60 seconds before re-fetching.
Fix the error in the fetch call to correctly disable caching.
const res = await fetch('/api/data', { cache: [1] });
Only 'no-store' fully disables caching in Next.js fetch.
Fill both blanks to fetch data with cache enabled and revalidate every 10 seconds.
const res = await fetch('/api/data', { cache: '[1]', next: { revalidate: [2] } });
Use 'force-cache' to enable caching and revalidate: 10 to refresh cache every 10 seconds.
Fill all three blanks to fetch data with no caching and a custom header.
const res = await fetch('/api/data', { cache: '[1]', headers: { '[2]': '[3]' } });
Use 'no-store' to disable cache, and add an Authorization header with a bearer token.
