Skip to content

Commit d1ba5db

Browse files
committed
reduce clickIdCache duration to 5 mins
1 parent f463c03 commit d1ba5db

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

apps/web/lib/tinybird/record-click.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,9 @@ export async function recordClick({
166166
};
167167

168168
if (shouldCacheClickId) {
169-
// cache the click ID and its corresponding click data in Redis for 1 day
169+
// cache the click ID and its corresponding click data in Redis for 5 minutes
170170
// we're doing this because ingested click events are not available immediately in Tinybird
171-
await redis.set(`clickIdCache:${clickId}`, clickData, {
172-
ex: 60 * 60 * 24, // cache for 1 day
173-
});
171+
await redis.set(`clickIdCache:${clickId}`, clickData, { ex: 60 * 5 });
174172
}
175173

176174
waitUntil(

0 commit comments

Comments
 (0)