因為Cache的關係, 在Flex第一次 load 之後, 就不會再到後端 Server load 資料
會以第一次取回的資料做處理
目前找到比較好的解決方法
暫時在Url裡傳入一個隨機產生變數
Ex.
var _random:String=(Math.floor(Math.random()*10000000*10)>>0).toString();
authService = new HTTPService();
authService.url = "UserInfoAction.action";
authService.method = "POST";
authService.useProxy = false;
authService.resultFormat = "e4x";
var parameters:* =
{
"random": _random
}
authService.addEventListener(ResultEvent.RESULT, handleResult);
authService.send(parameters);
這樣子基本上可以先暫時解決 HttpService Cache 的問題
HELLO~我也被這問題困擾很久
回覆刪除你的方法很不錯~
我提供有一個更好的方法~
假設後端伺服器是以jsp來說
在頁面放入取消快取,就可以達到此效果
程式碼如下:
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires",0);