Skip to content

Commit

Permalink
Merge pull request #58 from johnarban/prevent-caching
Browse files Browse the repository at this point in the history
make sure we always try to get the newest manifest available
  • Loading branch information
patudom authored Jun 11, 2024
2 parents d9e7366 + 154789f commit 549de94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/timestamps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export interface Manifest {

export async function fetchManifest(): Promise<Manifest> {
console.log("fetching manifest");
return fetch("https://raw.githubusercontent.com/johnarban/tempo-data-holdings/main/manifest.json").then((response) => response.json());
const url = "https://raw.githubusercontent.com/johnarban/tempo-data-holdings/main/manifest.json";
// try to use cache busting, but if that fails try with plain url
return fetch(`${url}?version=${Date.now()}}`)
.then((response) => response.json())
.catch(() => fetch(url).then((response) => response.json()));

}

interface Timestamps {
Expand Down

0 comments on commit 549de94

Please sign in to comment.