Disable Volley cache management

前端 未结 3 2102
生来不讨喜
生来不讨喜 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条回答
  •  Happy的楠姐
    2020-12-05 14:08

    You can create your RequestQueue from constructor and pass a NoCache object as the first parameter. The second parameter is a network transport based on your choice of AndroidHttpClient or HttpURLConnection.

    RequestQueue queue = new RequestQueue(new NoCache(), new BasicNetwork(new HurlStack()));
    

    For more details see this documentation.

    According to the documentation, BasicNetwork is Volley's default network implementation.

提交回复
热议问题