I am querying to server through flex,first time its show the result but when I insert a new record and query next开发者_如何转开发 time,its shows previous results only(problem facing in IE but not in chrome).
You can parametrize your http(?) request, and by setting an always changing parameter, you can make sure that your response never gets read from cache.
In the examples below I use a parameter with the name nocache
for this task:
You can set the nocache
parameter in your url string:
var url:String = "http://data.your.server?nocache=" + new Date().getTime();
Or -if you use a URLRequest
, you can set it inside its data member:
//the url from where you get the data
var url:String = "http://data.your.server";
var urlVars:URLVariables = new URLVariables();
urlVars.nocache = new Date().getTime();
//set the other parameters (if any)
//attach the parameter list to your request
var request:URLRequest = new URLRequest(url);
request.data = urlVars;
Update
Here the new Date().getTime()
will return the system's current time in milliseconds, so this way you can be sure, that it won't get called with this parameter value again.
That's because IE caches your request.
Add a random query string parameter to the remote URL you use, like http://myserver.com/fetch_data?random=4234324
(And by random I don't mean use 4234324 all the time, use actionscript to generate a random number and append it to the url)
See this KB from adobe
精彩评论