1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-11-14 21:40:49 -05:00

more error handling

This commit is contained in:
2025-03-31 09:15:40 -04:00
parent 50c184fb21
commit ec7c9fae54
15 changed files with 114 additions and 143 deletions

View File

@@ -9,7 +9,13 @@ const Gist = async ({ id, file }: GistProps) => {
const iframeId = `gist-${id}${file ? `-${file}` : ""}`;
const scriptUrl = `https://gist.github.com/${id}.js${file ? `?file=${file}` : ""}`;
const scriptResponse = await fetch(scriptUrl);
const scriptResponse = await fetch(scriptUrl, {
cache: "force-cache",
next: {
// cache indefinitely in data store
revalidate: 0,
},
});
if (!scriptResponse.ok) {
console.warn(`[gist] failed to fetch js:`, scriptResponse.statusText);