use etags

main
Zynh0722 2024-04-04 00:53:15 -07:00
parent 5f43470ed6
commit e2bfbf77a5
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ async function getTBAEndpoint(endpoint: string): Promise<TBAResponse> {
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;