Skip to content

Commit

Permalink
feat: expire entries every hour to clean up garbage entries over time
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud committed Dec 20, 2024
1 parent 01967b8 commit 6e7404d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function setCachedData(
key: string,
data: CacheEntry,
): Promise<void> {
await cache.put(key, JSON.stringify(data));
await cache.put(key, JSON.stringify(data), { expirationTtl: 3600 });
}

export const onRequest: PagesFunction<Env> = async (context) => {
Expand Down

0 comments on commit 6e7404d

Please sign in to comment.