title: Caching gifs in fresco
body: <p>I am trying to make a recyclerview with gifs. Everything shows perfectly but fresco do not cache gifs. After scroll recycler down and scroll up again, gifs are loading once again. I supposed they should be cached and loaded a bit quicker. Previously I used <a href="https://github.com/koush/ion" rel="nofollow">ION library</a>. Loading was quicker and did not have cache problem. I had to change lib because, it has some problem with gif decoding, described <a href="https://github.com/koush/ion/issues/619" rel="nofollow">here</a>. Current solution looks like that:</p>
  
  <pre><code>//for default initial in application class 
  
  Fresco.initialize(this);
  //I have also tried to change DiskCacheConfig and ImagePipelineConfig params. 
  //Without any positive result
  
  //for recyclerview on onBindViewHolder    
  GenericDraweeHierarchy hierarchy = holder.draweeView.getHierarchy();
  Uri uri = Uri.parse(path);
  hierarchy.setPlaceholderImage(R.drawable.img_bg);
  Logger.e(check(uri) + " " + uri.toString());
  DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(uri)
              .setAutoPlayAnimations(true).build();
      holder.draweeView.setController(controller);
  
  //for method which show cached uri images in imagepipeline
  public static boolean check(Uri uri) {
      ImagePipeline imagePipeline = Fresco.getImagePipeline();
      return imagePipeline.isInBitmapMemoryCache(uri);
  }
  //... all the time log shows "false + gif url"
  </code></pre>
  
  <p>I have not seen any information about not caching animated images. There is information about not supported image postprocessing for animations, but it's everything about that. How to correctly cache gifs?</p>
  
  <p><strong>edit:</strong>
  It looks like fresco cache animations, because below method return true for reloaded gifs.</p>
  
  <pre><code>public static boolean isImageDownloaded(Uri loadUri) {
      if (loadUri == null) {
          return false;
      }
      CacheKey cacheKey = DefaultCacheKeyFactory.getInstance()
              .getEncodedCacheKey(ImageRequest.fromUri(loadUri));
      return ImagePipelineFactory.getInstance().getMainDiskStorageCache().hasKey(cacheKey)
              || ImagePipelineFactory.getInstance().getSmallImageDiskStorageCache()
                      .hasKey(cacheKey);
  }
  </code></pre>