use etags
This commit is contained in:
parent
5f43470ed6
commit
e2bfbf77a5
1 changed files with 3 additions and 0 deletions
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 a new issue