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

[Feat Request] Caching for url assets out of the box #284

Open
sarthakpranesh opened this issue Jan 2, 2025 · 3 comments
Open

[Feat Request] Caching for url assets out of the box #284

sarthakpranesh opened this issue Jan 2, 2025 · 3 comments

Comments

@sarthakpranesh
Copy link

sarthakpranesh commented Jan 2, 2025

Description

I noticed on iOS network resource caching is working which is expected, but on android we don't have any cache layer control even though we are using Volley which provides response caching (maybe right now it works only if headers are provided?)

While implementing Rive in React Native it felt as the package also supports caching out of the box, which is not the case right now while other platform SDKs do provide it. I feel we should mention this somewhere in documentation (maybe a small note in Loading in Rive files section) for React Native implementation.

Provide a Repro

              <Rive
                url="https://someurl/qwerty.riv"
                fit={Fit.Contain}
                autoplay={true}
              />

Source .riv/.rev file

.riv

Expected behavior

I expected the animation file to be cached across app launches on both platforms android as well as ios

@christophemenager
Copy link

@sarthakpranesh their react-native documentation is pretty misleading unfortunately, I had the same problem with the "onLoad" missing callback, not documented.

Did you find a way to add a cache layer?

@sarthakpranesh
Copy link
Author

Hey @christophemenager
Yes, if you examine the code the package is using Volley. So I created a patch that uses Volley's caching capability on Android to cache Rive animation files.

@christophemenager
Copy link

@sarthakpranesh that's amazing! Would you be willing to share the patch here?
It could help mothers and maybe inspire the rive team for a PR

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