Hi,

 

Yeah, I don't want the caching  - the XML file I'm trying to retrieve
isn't getting updated without an app restart.

 

Jon

 

Von: Jeff Stedfast [mailto:[email protected]] 
Gesendet: 05 August 2011 17:04
An: Jon Hopkins
Cc: [email protected]
Betreff: Re: [MonoTouch] HttpWebRequest caching issue

 

Hi Jon,

 

Mono's implementation of HttpWebRequest doesn't support caching. It's a
feature that has never been implemented.

 

Hope that answers your question.

 

Jeff

On Fri, Aug 5, 2011 at 8:53 AM, Jon Hopkins <[email protected]>
wrote:

Hi,

 

Is the caching issue fixed, or is there a workaround. I found this 

 

http://stackoverflow.com/questions/4983782/monotouch-iphone-httpwebreque
st-turn-off-caching

 

after some searching but didn't get an answer. 

 

Code is

 

HttpWebRequest request =
WebRequest.Create(String.Format(UPDATE_REQUEST_URL, new
Random(999).ToString())) as HttpWebRequest;  // anti-caching URL

request.CachePolicy = new
System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.B
ypassCache);

request.Headers.Add("Cache-Control", "no-cache");

request.BeginGetResponse(new
AsyncCallback(ProcessHttpResponseAndForget), request);

 

thanks,

 

Jon


_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

 

_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to