Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

reduce clickIdCache duration to 5 mins

Steven Teyd1ba5db5f74c
diff --git a/apps/web/lib/tinybird/record-click.ts b/apps/web/lib/tinybird/record-click.ts
index 12b6a6f93e..8107b02772 100644
--- a/apps/web/lib/tinybird/record-click.ts
+++ b/apps/web/lib/tinybird/record-click.ts
@@ -166,11 +166,9 @@ export async function recordClick({
};
if (shouldCacheClickId) {
- // cache the click ID and its corresponding click data in Redis for 1 day
+ // cache the click ID and its corresponding click data in Redis for 5 minutes
// we're doing this because ingested click events are not available immediately in Tinybird
- await redis.set(`clickIdCache:${clickId}`, clickData, {
- ex: 60 * 60 * 24, // cache for 1 day
- });
+ await redis.set(`clickIdCache:${clickId}`, clickData, { ex: 60 * 5 });
}
waitUntil(