Buckets:
| import { unstable_cache } from 'next/cache' | |
| import { Suspense } from 'react' | |
| const getData = unstable_cache( | |
| async (cache) => { | |
| const res = await fetch( | |
| 'https://next-data-api-endpoint.vercel.app/api/random', | |
| { cache } | |
| ) | |
| return res.text() | |
| }, | |
| undefined, | |
| {} | |
| ) | |
| async function Data({ cache = undefined }) { | |
| const data = await getData(cache) | |
| return <div id="data">{data}</div> | |
| } | |
| export default function Page({ cache = undefined }) { | |
| return ( | |
| <Suspense fallback={<div id="loading">Loading...</div>}> | |
| <Data cache={cache} /> | |
| </Suspense> | |
| ) | |
| } | |
Xet Storage Details
- Size:
- 592 Bytes
- Xet hash:
- 0b1572f012057bcd86b9daa647b21016c28f826980ba05dde0f104c7eb20dfc2
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.