每次 Return WP8 中的旧数据
Every Time Return Old Data in WP8
我正在使用 PHP WebService。
更新条目后它再次 return 旧数据。
WebClient webClient = new WebClient();
webClient.DownloadStringCompleted += jobseeker;
webClient.DownloadStringAsync(new Uri(string.Format("http://ec2-54-41-130-155.ap-southeast-2.compute.amazonaws.com/board/api/abc.php?func=myaccount&user_id={0}", Empid)));
这是由于 WebClient
自动缓存了结果。要克服这个问题,请使用 cache buster
。也就是说,将一个随机字符串作为 url parameter
添加到您的 url
.
因此,Uri
将是
Uri _uri = new Uri("APIURL/abc.php?func=myaccount&user_id={0}&cachebust=" + DateTime.Now.ToString();
当我将我的应用程序连接到我的 WAMP 服务器时,我遇到了同样的缓存。
我正在使用 PHP WebService。
更新条目后它再次 return 旧数据。
WebClient webClient = new WebClient();
webClient.DownloadStringCompleted += jobseeker;
webClient.DownloadStringAsync(new Uri(string.Format("http://ec2-54-41-130-155.ap-southeast-2.compute.amazonaws.com/board/api/abc.php?func=myaccount&user_id={0}", Empid)));
这是由于 WebClient
自动缓存了结果。要克服这个问题,请使用 cache buster
。也就是说,将一个随机字符串作为 url parameter
添加到您的 url
.
因此,Uri
将是
Uri _uri = new Uri("APIURL/abc.php?func=myaccount&user_id={0}&cachebust=" + DateTime.Now.ToString();
当我将我的应用程序连接到我的 WAMP 服务器时,我遇到了同样的缓存。