Skip to content

Commit

Permalink
re-cache json docs on request (#9899)
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders-ms authored Mar 1, 2024
1 parent e2ef6ac commit 6aa01e3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions teachertool/src/services/backendRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { logError } from "./loggingService";

export async function fetchJsonDocAsync<T = any>(url: string): Promise<T | undefined> {
try {
const response = await fetch(url);
const response = await fetch(url, {
cache: "no-cache",
});
if (!response.ok) {
throw new Error("Unable to fetch the json file");
} else {
Expand Down Expand Up @@ -70,7 +72,9 @@ export async function loadTestableCollectionFromDocsAsync<T>(fileNames: string[]
let allResults: T[] = [];
for (const planFile of files) {
try {
const response = await fetch(planFile);
const response = await fetch(planFile, {
cache: "no-cache",
});

if (response.ok) {
const content = await response.json();
Expand Down

0 comments on commit 6aa01e3

Please sign in to comment.