private static String filenameForUrl(String url, FileExtension extension, boolean isTemp) {
    String prefix = "lottie_cache_";
    String suffix = (isTemp ? extension.tempExtension() : extension.extension);
    String sanitizedUrl = url.replaceAll("\\W+", "");
    // The max filename on Android is 255 chars.
    int maxUrlLength = 255 - prefix.length() - suffix.length();
    if (sanitizedUrl.length() > maxUrlLength) {
      // If the url is too long, use md5 as the cache key instead.
      // md5 is preferable to substring because it is impossible to know
      // which parts of the url are significant. If it is the end chars
      // then substring could cause multiple animations to use the same
      // cache key.
      // md5 is probably better for everything but:
      //     1. It is slower and unnecessary in most cases.
      //     2. Upon upgrading, if the cache key algorithm changes,
      //        all old cached animations will get orphaned.
      sanitizedUrl = getMD5(sanitizedUrl, maxUrlLength);
    }

    return prefix + sanitizedUrl + suffix;
  }
Returns the cache file for the given url if it exists. Checks for both json and zip.
Returns null if neither exist.
lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java