When developing Windows Phone solutions, I've become quite fond
of using the HttpWebRequest class to fetch information from the
web, either if it's in XML or in JSON. I've also had the
requirement to pull data down very often (as often as every 15
seconds) from the same URL and then stumbled into some issues. It
seems like the Windows Phone platform is examining the URL you
request and if you try to fetch data from the same URL as previous
it will simply reply with a locally cached respones with the same
data as earlier. This is probably not what you want and the
solution is the following:
private HttpWebRequest CreateRequest(string url)
{
var request = CreateRequest(url);
if (request.Headers == null)
request.Headers = new WebHeaderCollection();
request.Headers[HttpRequestHeader.CacheControl] = "no-cache";
request.Headers[HttpRequestHeader.IfModifiedSince] = DateTime.UtcNow.ToString();
return request;
}