From e2bfbf77a5a01abb8ddf20a63f4d917b88a0e3a2 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Thu, 4 Apr 2024 00:53:15 -0700 Subject: [PATCH] use etags --- index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.ts b/index.ts index 951f778..ebf50cc 100644 --- a/index.ts +++ b/index.ts @@ -68,6 +68,9 @@ async function getTBAEndpoint(endpoint: string): Promise { console.log("Fetching... " + endpoint); const headers = new Headers(authHeaders); + if (tbaCache[endpoint]) { + headers.append("If-None-Match", tbaCache[endpoint].etag); + } const response = await fetch(BASE_URL + endpoint, { headers }); let data;