Skip to content

Commit 418e5cf

Browse files
committed
firefox fix
1 parent 0646a91 commit 418e5cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/theme/IdealImage/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ export default function IdealImage(
231231
const startTime = performance.now();
232232

233233
try {
234-
const response = await fetch(url, { signal, cache: "force-cache" });
234+
const response = await fetch(url, { cache: "no-store" });
235+
await response.blob(); // Ensures full download
235236
const endTime = performance.now();
236237
const duration = (endTime - startTime) / 1000;
237238

@@ -241,7 +242,7 @@ export default function IdealImage(
241242
console.log("Took too long, setting as 3g");
242243
setNetworkType("3g");
243244
} else {
244-
console.log("Loaded quickly, setting as 4g");
245+
console.log(`Loaded ${url} quickly in ${duration}, setting as 4g`);
245246
setNetworkType("4g");
246247
}
247248
} catch (error) {

0 commit comments

Comments
 (0)