Repository navigation
fix: isolate header-bearing iOS images from URL-only HTTP caching - #963
Conversation
…he on Android too - Android (React Native and standalone packages): header-bearing requests use an OkHttp client without the disk cache, mirroring the iOS session split; header names are lower-cased once for the cache key and the request - iOS: keep local images keyed by URL as before, drop the redundant per-request cache policy, document the case-insensitive key - docs: the disk cache is bypassed for custom-header requests on both platforms - drop the XCTest suite and its project entries Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
@juliusmarminge thanks, this is the fix Ernest asked for in #852 and the iOS half is right. I pushed a follow-up commit (7b5d83b) on top:
Verified on an iPhone 17 simulator and a Pixel 9 emulator against a local server that returns a different image per Worth a release-notes line: images fetched with custom headers no longer persist across app launches. cc. @jnowakow |
…he in the Swift package Same split as the other implementations: a second URLSession without a URLCache for requests with custom headers, header names lower-cased once for the cache key and the request. Digest pins in ImageCacheKeyTests follow the lower-cased names. Docs state that header-bearing responses are not persisted on disk. Comments trimmed to one line across all four copies. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
One more commit (abe57e7): the Swift package That covers all four implementations: React Native iOS and Android, the standalone Android package and the Swift package. cc. @maksg |
What/Why?
The decoded image cache includes request headers, but
NSURLSessioncan return HTTP-cached bytes for the same URL under another header set. Use a session withoutURLCachefor header-bearing requests, retaining the decoded header-aware cache and in-flight deduplication. Requests without headers keep ordinary HTTP caching.Normalize header-name casing once for both cache identity and the actual request. Duplicate case aliases therefore resolve to the same deterministic value that is sent on the wire.
Fixes #956. This is the narrow cache fix invited in #852, separate from the deferred media API proposals.
Testing
NSURLProtocoldownload.Local native proof uses an isolated upstream example checkout on an iPhone 17 Pro simulator running iOS 27. Xcode used two jobs, disabled signing/index/debug symbols, and task-owned XCFrameworks retained the arm64 simulator slice to fit the host. These are host resource settings, not workflow or production changes. No Android device, VoiceOver traversal, or full Maestro-suite pass is claimed.
Base: b80be973. Current head: 156451e6. Current-head library/lint/Android checks passed. iOS checks remain queued; CI is incomplete.
PR Checklist
Model: GPT-6.1. Harness: Codex in T3 Code.