fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Cancel Prefetch Requests

Open sourabhv opened this issue 11 years ago • 3 comments

In my app I was prefetching images so they load faster when user scrolls using prefetchToBitmapCache. Now when user applies a filter, these prefetches remain in pipeline and slow down the loading of new images.

How I am prefetching: When use scrolls down through images, I prefetch X number of images after LinearLayoutManager.findLastVisibleItemPosition()'s value. I need a way to cancel all these prefetches when user applies a filter. Is there a way to do this or a better way of prefetching?

sourabhv avatar Nov 26 '15 20:11 sourabhv

Answered on stack overflow: http://stackoverflow.com/a/34076700/3027862

plamenko avatar Dec 05 '15 00:12 plamenko

I tried this today but unfortunately it didn't work. I get true from DataSource.close() but the request still finishes and image is downloaded

sourabhv avatar Dec 10 '15 10:12 sourabhv

Ping! I tried it in a separate but it still didn't work. Any idea why?

sourabhv avatar Dec 28 '15 09:12 sourabhv