use etags

This commit is contained in:
Zynh0722 2024-04-04 00:53:15 -07:00
parent 5f43470ed6
commit e2bfbf77a5

View file

@ -68,6 +68,9 @@ async function getTBAEndpoint(endpoint: string): Promise<TBAResponse> {
console.log("Fetching... " + endpoint); console.log("Fetching... " + endpoint);
const headers = new Headers(authHeaders); const headers = new Headers(authHeaders);
if (tbaCache[endpoint]) {
headers.append("If-None-Match", tbaCache[endpoint].etag);
}
const response = await fetch(BASE_URL + endpoint, { headers }); const response = await fetch(BASE_URL + endpoint, { headers });
let data; let data;