-
-
Notifications
You must be signed in to change notification settings - Fork 458
Added option for json-file repo #226
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
Conversation
if it stores the objects in memory, isn't that a problem with image data like map tiles? |
I have to run some memory tests for comparison, but it only stores some meta info. I can imagine that the sqlite connection uses more memory for relatively small amounts of objects. The amount of objects should never get into the hundreds as that would be much for the cache anyway. |
Codecov Report
@@ Coverage Diff @@
## develop #226 +/- ##
===========================================
+ Coverage 73.26% 75.22% +1.95%
===========================================
Files 17 18 +1
Lines 475 565 +90
===========================================
+ Hits 348 425 +77
- Misses 127 140 +13
Continue to review full report at Codecov.
|
it is only storing the metadata in memory, not the binary files as far as i understand it, You'd have to cache a lot of objects before you reach the size of the |
This here was then a bit missleading:
As a cache is just a map<id,image> there are no queries necessary so I see no real benefit of using Sqlite. |
Sorry, the naming can be better indeed. (It is already improving though). The info on a cached files is called a CacheObject. This include info for example on the eTag, the fileName, when it is last used: https://github.com/Baseflow/flutter_cache_manager/blob/develop/flutter_cache_manager/lib/src/storage/cache_object.dart When the cache is used it also checks how many files there are and when the last time was that the files were used. |
Sounds good! |
Verified it works on Linux and Windows. |
Very happy to see this. |
I expect to release it later today as version 2.0.0-beta, but will have to write at least a bit of documentation mentioning the breaking changes. |
✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)
Feature
Currently only sqflite is supported out of the box. This doesn't work on all platforms.
🆕 What is the new behavior (if this is a feature change)?
Added a simple json-file provider that stores the objects in memory and caches the info in a json based file.
This works on all platforms that are supported by path_provider.
💥 Does this PR introduce a breaking change?
No, it is only made the default on platforms that were not supported yet.
🐛 Recommendations for testing
Test still need to be written.
📝 Links to relevant issues/docs
Fixes #224
Fixes #222
Fixes #197
🤔 Checklist before submitting