mirror of
https://github.com/logos-storage/ethcc-demo.git
synced 2026-01-04 14:13:10 +00:00
aggressively cache images browser-side
This commit is contained in:
parent
3ef0e8dcb4
commit
e3390a0bc1
@ -51,7 +51,11 @@ async function fetchImage(cid) {
|
||||
let response
|
||||
let options = {
|
||||
// This will abort the fetch when either signal is aborted
|
||||
signal: AbortSignal.any([controller.signal, timeoutSignal])
|
||||
signal: AbortSignal.any([controller.signal, timeoutSignal]),
|
||||
// The browser looks for a matching request in its HTTP cache.
|
||||
// If there is a match, fresh or stale, it will be returned from the cache.
|
||||
// If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource.
|
||||
cache: 'force-cache'
|
||||
}
|
||||
if (props.localOnly) {
|
||||
response = await codexApi.downloadLocal(cid, options)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user