Skip to content

Get cache size #239

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

Closed
alr2413 opened this issue Oct 20, 2020 · 9 comments
Closed

Get cache size #239

alr2413 opened this issue Oct 20, 2020 · 9 comments
Labels
type: enhancement New feature or request

Comments

@alr2413
Copy link

alr2413 commented Oct 20, 2020

Hi,
in the previous version 1.x.x, we can use the await DefaultCacheManager().getFilePath() syntax to get the default cache directory path. how should we get that path in the new version 2 since there is no "getFilePath()" method anymore?
Thanks in advance

@renefloor
Copy link
Contributor

What's the usecase that you need to know the directory path?

@alr2413
Copy link
Author

alr2413 commented Oct 20, 2020

To calculate the cache size as mentioned in #83

@renefloor
Copy link
Contributor

renefloor commented Oct 30, 2020

I've been thinking about adding the getFilePath again, but that is not really a great solution. For example for web there is not really a path, so it wouldn't be consistent over platforms. I think it is better to implement a method to get the cache size. Would that be a good alternative for you?

@alr2413
Copy link
Author

alr2413 commented Oct 31, 2020

Yea, i've checked the previous version of the package and figured out how to add the "getFilePath" method to my custom implementation.
Thanks.

@renefloor renefloor changed the title Get default cache directory path Get cache size Nov 19, 2020
@renefloor renefloor added the type: enhancement New feature or request label Nov 19, 2020
@kamike
Copy link

kamike commented Dec 30, 2020

same question

@esiqveland
Copy link

Is there currently a way to get the total size of cache and the number of objects cached?

@aintend-com
Copy link

Is this implemented?

@jithware
Copy link

@renefloor how about something like:

https://github.com/jithware/flutter_cache_manager/blob/develop/flutter_cache_manager/lib/src/cache_store.dart#L194-L198

@Nico04
Copy link

Nico04 commented Nov 3, 2023

Related to #398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants