Disable Volley cache management

前端 未结 3 2099
生来不讨喜
生来不讨喜 2020-12-05 13:50

Is there a way I could disable the Volley cache management? My app is using Google Volley library to manage the transport layer, but I have my own cache manager implementati

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 14:03

    request.setShouldCache(false);
    

    does not seem to be enough for GET requests. however, clearing the cache before adding to the queue seems to help

    myRequestQueue.getCache().clear();
    

    I put this in my getRequestQueue() method in my Volley singleton. before returning the queue.

提交回复
热议问题