Skip to main content
Version: Next

cacheLife

cacheLife(ttl): void

Sets the TTL for the current cache operation

const fetchData = cache(async () => {
cacheLife('30m');
return await expensiveOperation();
});
ParameterTypeOptionalDescription
ttlstringnumber