File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,8 @@ export default function IdealImage(
231
231
const startTime = performance . now ( ) ;
232
232
233
233
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
235
236
const endTime = performance . now ( ) ;
236
237
const duration = ( endTime - startTime ) / 1000 ;
237
238
@@ -241,7 +242,7 @@ export default function IdealImage(
241
242
console . log ( "Took too long, setting as 3g" ) ;
242
243
setNetworkType ( "3g" ) ;
243
244
} else {
244
- console . log ( " Loaded quickly, setting as 4g" ) ;
245
+ console . log ( ` Loaded ${ url } quickly in ${ duration } , setting as 4g` ) ;
245
246
setNetworkType ( "4g" ) ;
246
247
}
247
248
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments