yale8848/CacheWebView

动态缓存是不是还没有实现

Kunsan16 opened this issue · 1 comments

这段代码是不是没用到

if (isEnableDynamicCache()) {
        File file = DynamicCacheLoader.getInstance().getResByUrl(mDynamicCacheFile, url);
        if (file != null) {
          CacheWebViewLog.d(String.format("from dynamic file: %s", url), mDebug);
          String mimeType = MimeTypeMapUtils.getMimeTypeFromUrl(url);
          InputStream inputStream = null;
          try {
            inputStream = new FileInputStream(file);
          } catch (FileNotFoundException e) {
            e.printStackTrace();
          }
          WebResourceResponse webResourceResponse = new WebResourceResponse(mimeType, "",
              inputStream);
          return webResourceResponse;
        }
      }

这段代码是不是没用到

if (isEnableDynamicCache()) {
        File file = DynamicCacheLoader.getInstance().getResByUrl(mDynamicCacheFile, url);
        if (file != null) {
          CacheWebViewLog.d(String.format("from dynamic file: %s", url), mDebug);
          String mimeType = MimeTypeMapUtils.getMimeTypeFromUrl(url);
          InputStream inputStream = null;
          try {
            inputStream = new FileInputStream(file);
          } catch (FileNotFoundException e) {
            e.printStackTrace();
          }
          WebResourceResponse webResourceResponse = new WebResourceResponse(mimeType, "",
              inputStream);
          return webResourceResponse;
        }
      }

image

实现了,在这里