How to disable http caching in applet

后端 未结 2 1206
甜味超标
甜味超标 2021-01-15 11:59

How can i disable http caching of all my http connections in my japplet? I dont want any of my http (request/response)to be cached.Regardless of the user se

相关标签:
2条回答
  • 2021-01-15 12:11

    You can disable caches using URLConnection.setUseCaches(boolean)

    0 讨论(0)
  • 2021-01-15 12:21

    An easy way to break caching is to add a random value to the url ala:

    String url = "http://www.example.com/?noCache=" + Math.Random();

    0 讨论(0)
提交回复
热议问题