-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
1.fix over maxsize limit not delete file #139
base: master
Are you sure you want to change the base?
Conversation
2.fetchContentInfo use http header information for faster
2.fetchContentInfo use http header information for faster
@@ -47,7 +47,7 @@ static void makeDir(File directory) throws IOException { | |||
static void setLastModifiedNow(File file) throws IOException { | |||
if (file.exists()) { | |||
long now = System.currentTimeMillis(); | |||
boolean modified = file.setLastModified(now); // on some devices (e.g. Nexus 5) doesn't work | |||
boolean modified = file.setLastModified(now/1000*1000); // on some devices (e.g. Nexus 5) doesn't work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alway throw new IOException。because in some android device file.setLastModified return false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ta893115871 please explain you fix. Who and when does throw IOException
? Why you divide now to 1000*1000
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can test when the cache file over maxsize limit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ta893115871 some servers doesn't response to HEAD requests. What is why I removed HEAD requests |
2.fetchContentInfo use http header information for faster