use etags
parent
5f43470ed6
commit
e2bfbf77a5
3
index.ts
3
index.ts
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue