From 4b3d4bca19d03d421c8adf13fe97fb7701ae8174 Mon Sep 17 00:00:00 2001 From: Ayo Date: Thu, 7 Aug 2025 17:40:29 +0200 Subject: [PATCH] feat: prefix redis key with 'cozy:url:' --- src/pages/index.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 9696b13..ff05b27 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -22,7 +22,7 @@ while (url?.startsWith(Astro.url.origin)) { if (url) { // try cache - article = (await client.json.get(url)) as ArticleData + article = (await client.json.get('cozy:url:' + url)) as ArticleData if (article !== null) { console.log('>>> Using cached content', article.url) } else { @@ -31,7 +31,7 @@ if (url) { console.log('>>> Using fetched content', article?.url) if (article !== null) { // cache via redis - await client.json.set(url, '$', article) + await client.json.set('cozy:url:' + url, '$', article) console.log('>>> Added to cache', article.url) } } catch {