Comments (9)
Hi Lexs,
Is it possible to write cache into a cache directory which is located in SD Card?(/mnt/sdcard/data/somepackagename/cache/images/)
In my opinion, Android would never clear this, and this could be a workaround.
from disklrucache.
Yes, this would work but will introduce other problems, for example that SD storage can be removed at any time or not even be available. I guess these issues could be worked around as well though.
from disklrucache.
Give the dev
branch a try. Threw in a quick sanity check and attempted directory recreation.
from disklrucache.
Gerrit tracking: https://android-review.googlesource.com/31430
from disklrucache.
What happened to this? Should I still try dev? I'm asking as my image loader is based on this and when they user clicks "clear cache" in app info all new writes will fail if the app was open.
from disklrucache.
It's fixed on dev
but I didn't like the solution. Maybe @swankjesse can comment as to a better solution.
from disklrucache.
My original preference was for the cache to stop caching if ever it runs into a hostile storage system. But in @lexs scenario, that's probably to heavy-handed. It would probably be more robust for the cache tried its best to keep caching even as things disappeared out from under it.
That way, if a user clicks 'clear cache' while the app is open, performance won't degrade indefinitely.
@JakeWharton can you assign this to me? I'll code up a fix.
from disklrucache.
Sadly I still haven't gotten around to doing this work. If you'd prefer to tackle it, it's all yours. Otherwise I'll circle back when I have time.
from disklrucache.
New implementation of this on dev
.
from disklrucache.
Related Issues (20)
- Clear Cache HOT 1
- Copyright (C) 2011 The Android Open Source Project Copyright 2012 Jake Wharton Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- executorService is not shut down
- Can you support the OpenHarmony JavaScript version? HOT 1
- Does getCacheDir() supported? HOT 3
- Simplify interface and make lib truly asynchronous HOT 4
- Multi-thread: Infinite loop in trimToSize HOT 5
- Closing the correct resource ? HOT 1
- Validate key Issue HOT 1
- max size doesn't take in consideration minimum 4kb block size. HOT 2
- Files disappear after a while HOT 1
- Old Image is always shown HOT 1
- Basic usage and code samples? HOT 1
- [Question] Where is the performence report of DiskLruCache? HOT 1
- what can cause cache is closed
- Hey! 61 tests 10 failed I have... HOT 5
- Request for new release 2.0.3 HOT 1
- Get entry count/iterator
- while loop in StrictLineReader.java HOT 2
- Key length is 64 for dependencies resolved via maven/jcenter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disklrucache.