From 02cc50f9816df0866791de81f99f87550f63ce4f Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Wed, 25 Mar 2026 20:49:20 +0000
Subject: [PATCH] perf: Cache domain searches to prevent redundant API calls
- Adds a module-level `Map` cache with a TTL (5 minutes) for search results in `DomainSearch.svelte`.
- Limits cache size to 500 entries with FIFO eviction to prevent SSR memory leaks.
- Normalizes search terms using `toLocaleLowerCase()`.
- Uses `onDestroy` to clean up the `debounceTimer` to prevent memory leaks and issues on component unmount.
Co-authored-by: yeboster <23556525+yeboster@users.noreply.github.com>
---
src/routes/DomainSearch.svelte | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/src/routes/DomainSearch.svelte b/src/routes/DomainSearch.svelte
index 53d006f1..6e6f821d 100644
--- a/src/routes/DomainSearch.svelte
+++ b/src/routes/DomainSearch.svelte
@@ -1,9 +1,20 @@
+
+