Repository navigation
fix(ios): honor cacheType and headers in ImagePipeline prefetch - #69
Merged
farfromrefug merged 1 commit intoOct 8, 2026
Conversation
prefetchToCacheType ignored its cacheType argument: SDWebImagePrefetcher's
default context stores to disk+memory either way, so a disk prefetch also
decoded and warmed memory — diverging from Android's bytes-only Glide
downloadOnly. And getContextFromOptions dropped PrefetchOptions.headers
because it never set SDWebImageContextDownloadRequestModifier, so
prefetch({ headers }) silently sent no headers on iOS while Android's
CustomGlideUrl forwarded them.
This restores the 4.x behavior: set SDWebImageContextStoreCacheType on the
prefetch context and apply options.headers through a request modifier in
getContextFromOptions (which also fixes headers for getCacheKey and the
other prefetch callers). Additionally sets
SDWebImageContextOriginalStoreCacheType so a memory prefetch does not
spill original bytes to disk.
aleclarson
added a commit
to octane-xplat/octane-xplat
that referenced
this pull request
Oct 8, 2026
Filed upstream PRs for the five patch-audit fixes and recorded them via a new upstreamPR field on the manifest entries: - nativescript-community/octane#14 — setProp undefined-skip, visibility capability, intrinsic ref types - nativescript-community/octane#15 — vite-octane .tsrx HMR matching and recipients counting - nativescript-community/ui-image#69 — iOS prefetch cacheType + headers - nfrasser/linkifyjs#572 — ICU-free \p{} regex construction - facebook/lexical#9334 — @lexical/link URL_REGEX via new RegExp - NativeScript/NativeScript#11514 — font-weight → wght axis mapping on Android (issue #11513)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two iOS prefetch regressions vs. the 4.x line:
prefetchToCacheTypeignores itscacheTypeargument.SDWebImagePrefetcher's default context stores to disk+memory either way, so adiskprefetch also decodes and warms memory — diverging from Android's bytes-onlyGlide.downloadOnlybehavior.getContextFromOptionsdropsPrefetchOptions.headersbecause it never setsSDWebImageContextDownloadRequestModifier, soprefetch({ headers })silently sends no headers on iOS while Android'sCustomGlideUrlforwards them.Fix
Ports the 4.x implementation forward:
prefetchToCacheTypesetsSDWebImageContextStoreCacheTypeon the prefetch context, plusSDWebImageContextOriginalStoreCacheTypeso a memory prefetch does not spill original bytes to disk.getContextFromOptionsappliesoptions.headersthrough anSDWebImageDownloaderRequestModifier— same pattern as the existingImg.headershandling inupdateView, which also fixes headers forgetCacheKeyand the other prefetch callers.Upstream-relevant note: 4.x additionally allowed
headersas a() => Record<string, string>thunk; 5.x types itRecord<string, string>only, so this uses the plain form.