Skip to main content
Version: Next

CacheTag

cacheTag

Sets a custom identifier for the current cache operation

Example

const fetchUser = cache(async (id: string) => {
cacheTag(`user:${id}`);
return await db.users.findOne(id);
});
Signature
function cacheTag(tag: string): void

Parameters

tag

parameter
string