Closed zkjxx1548 closed 2 years ago
@zkjxx1548 Not sure if it is good, bad or badly documented (or 2 out of 3), but this is done so files are kept in the cache for at least 1 day. Having a long list and already start deleting items while you scroll might give unexpected behaviour as the app might expect the file to be there. By setting it to at least 1 day this prevents the behaviour of files being removed directly.
The questionmark is set with:
whereArgs: [
DateTime.now().subtract(const Duration(days: 1)).millisecondsSinceEpoch
],
After testing, the cache will be properly cleaned up after one day.
Thanks!
Hello from 2022. 👋
Having a long list and already start deleting items while you scroll might give unexpected behaviour as the app might expect the file to be there. By setting it to at least 1 day this prevents the behavior of files being removed directly.
This behavior seems a bit weird, is the only way to change this overriding the CacheObjectProvider
? :)
💬 'maxNrOfCacheObjects' can not WORK
Related version info:
Context:
Result:
It is not working, we find that when the number of currently cached pictures is greater than maxNrOfCacheObjects, the operation will not trigger the cache cleanup mechanism in any case.
We found the reason may be:
The sql statement is redundant with a question mark:
We try to remove the
WHERE touched < ?
, it can works.So it is a bug? Or The way we use is wrong