Skip to content

CacheExtensionConfig.addExtension() doesn't work #196

Description

@tonyxu99

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions