No Cached Source

1 vote · 0 comments

I had a problem with TMO's caches when testing my app. It would always return the data from when I first ran my app. I used this code to get around it in case anyone else is interested.

raw ·
copy
· download
URL myURL = new URL("http://www.yourURL.com/"); /* Open a connection to that URL. */ URLConnection ucon = myURL.openConnection(); ucon.setUseCaches(false); ucon.setRequestProperty("Cache-Control", "no-cache");

Be the first to comment

Sign in with OpenID