Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clearCache does not clear cache completely #49

Open
jamesholcomb opened this issue Jul 2, 2024 · 1 comment
Open

clearCache does not clear cache completely #49

jamesholcomb opened this issue Jul 2, 2024 · 1 comment

Comments

@jamesholcomb
Copy link

"@candlefinance/faster-image": "1.6.2"

on iOS 17 (both device and simulator), calling clearCache() seems to only partially work. I don't see a pattern, but some (most?) of the sources do indeed reload from network. The returned promise always resolves.

In my scenario, I cache static images from an API whose requests look like:

https://api.mapbox.com/styles/v1/mapbox/outdoors-v11/static/pin-s-star+FF0000(-95.98435239999999,36.1040077)/-95.98435239999999,36.1040077,15.5/393x130@2x?access_token=pk.eyJ1xxxxxxx&attribution=false&logo=true

is it possible to return information about the network request (or cache hit) in the onSuccess handler? That might help diagnose caching issues.

❯ npx react-native info
info Fetching system and libraries information...
System:
  OS: macOS 13.6.6
  CPU: (10) arm64 Apple M1 Max
  Memory: 55.52 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.14.0
    path: ~/.nvm/versions/node/v20.14.0/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v20.14.0/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v20.14.0/bin/npm
  Watchman:
    version: 2024.04.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10811636
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.22
    path: /usr/bin/javac
  Ruby:
    version: 2.7.7
    path: /Users/jamesholcomb/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.7
    wanted: 0.72.7
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false 
@gtokman
Copy link
Member

gtokman commented Jul 3, 2024

@jamesholcomb, thanks for the report. I wonder if the URLSession cache also needs to be cleared. I have some bandwidth to check this out & the onSuccess callback bug this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants