Skip to main content
Version: Next

CacheLife

cacheLife

Sets the TTL for the current cache operation

Example

const fetchData = cache(async () => {
cacheLife('30m');
return await expensiveOperation();
});
Signature
function cacheLife(ttl: number | string): void

Parameters

ttl

parameter
number | string