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

[feature] rive cache implemented like flare cache #86

Open
talamaska opened this issue Apr 13, 2021 · 4 comments
Open

[feature] rive cache implemented like flare cache #86

talamaska opened this issue Apr 13, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@talamaska
Copy link

talamaska commented Apr 13, 2021

I believe this can be done, after all cache stores bytes and this what the RiveFile wants right?
It would be nice if we can leverage root bundle and warmup rive files.
I don't have metrics or example where I see loading slowness, now that we don't have rasters, the size of the same animation is 6kb vs the old one 275kb. It might come handy to preload multiple rive files.

@fredgrott
Copy link

asset_cache will work to cache the binary riv file

@luigi-rosso
Copy link
Contributor

This wasn't implemented because we were lacking a core feature that prevented an efficient caching solution from working. Good news is we now have it, so a caching solution can be implemented. For reference: #109

Previously when you loaded a .riv file, the deserialized content would be modified by animations, meaning it couldn't be re-used if the file was shown in another part of the app. It would need to be reloaded from raw bytes which meant cycles would be wasted on deserialization and initialization which can be expensive on complicated files.

What that all means is that a caching solution for the raw bytes wasn't sufficient, we need to cache the deserialized file and its artboards. Then instance the artboards on demand when a part of the app needs them from the already initialized source.

We can now add Flutter caching to our roadmap, I'll keep this issue open and reference it as we make progress.

@ps6067966
Copy link

asset_cache will work to cache the binary riv file

How?

@HayesGordon
Copy link
Contributor

Related to: #68

@HayesGordon HayesGordon added the enhancement New feature or request label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants