Skip to main content

bn.getPrefetchCacheSync

getPrefetchCacheSync(options): PrefetchCacheResult

get prefetch cache data synchronously. If prefetch data is not ready, it will return undefined.

example

let res
try {
res = bn.getPrefetchCacheSync?.({ url: 'https://nezha-mock.fe.qa1fdg.net/order' })
} catch(e) {}
console.log(res, res.result)

Parameters

NameTypeDescription
optionsPrefetchCacheOptionsprefetch cache options

Returns

PrefetchCacheResult

prefetch cache result

Interface: PrefetchCacheOptions

NameTypeDescription
urlstringrequest url

Interface: PrefetchCacheResult

NameTypeDescription
resultanyprefetch cache data