Skip to content
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

CacheExtensionConfig.addExtension() doesn't work #196

Open
tonyxu99 opened this issue Oct 25, 2021 · 0 comments
Open

CacheExtensionConfig.addExtension() doesn't work #196

tonyxu99 opened this issue Oct 25, 2021 · 0 comments

Comments

@tonyxu99
Copy link

tonyxu99 commented Oct 25, 2021

For my use case, I want to cache "mp4" files. I use the following code:
CacheExtensionConfig extension = new CacheExtensionConfig();
extension.addExtension("mp4");
builder.setCacheExtensionConfig(extension);

However, the mp4 files still won't be cached. I have checked the source code (CacheExtensionConfig.java), this is the issue:
public boolean isMedia(String extension) {
if (TextUtils.isEmpty(extension)) {
return false;
}
if (NO_CACH.contains(extension)) {
return true;
}
return no_cache.contains(extension.toLowerCase().trim());
}
"mp4" is in NO_CACHE static HashSet. Therefore, there is no way to cache mp4 files even if we have added "mp4" to no_cashe
HashSet varible. I suggest that you should remove
if (NO_CACH.contains(extension)) {
return true;
}

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant