From 0cbcc73326ac46d2874162cb0b5f214852461319 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sun, 15 Feb 2026 11:00:07 -0800 Subject: [PATCH] Refactor: Reduce rate-limit TTL to 25 hours --- functions/[[path]].js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/[[path]].js b/functions/[[path]].js index 43a01f5..92fa689 100644 --- a/functions/[[path]].js +++ b/functions/[[path]].js @@ -62,9 +62,10 @@ export async function onRequest(context) { } // Write a unique rate key BEFORE doing the search (claim the slot) + // TTL of 25 hours is enough to cover the remainder of the UTC day const rateEntryKey = `${ratePrefix}${Date.now()}-${crypto.randomUUID()}`; await env.DIRECT_IMG_RATE.put(rateEntryKey, "1", { - expirationTtl: 48 * 60 * 60, + expirationTtl: 25 * 60 * 60, }); // Notify of a new search (Cache Miss)