nachbar (45) [Avatar] Offline
#1
And then just when everything was working in the debug Flash Player, I decided to fire-up IE & run the application in Flash Player in non-debug mode, and it stopped working: after creating an item, the list blanked out rather than being updated.

Since I initially posted this, I have determined that IE 7 is not even sending the request for the updated, and modified, list to rails, when the application runs in the non-debug version of Flash Player. Firefox, however, does, and thus the application works perfectly in Firefox (or in Flash Player in Debug mode)

Thus, the caching is occuring entirely within Flash/IE, but only when Flash is in non-debug mode.

A "conditional get" can produce a 304 "not modified" response, and that is what I had thought was occurring. However, that IS occurring when other lists are being retrieved. According to Microsoft, the "no-cache" header should prevent caching. The "no-cache" header IS being set in the controller, so that doesn't appear to prevent the problem. It also doesn't seem to prevent the 304 response from being sent by Rails.

For some reason, even though I am creating a new HTTPService object for each call, the return from the POST (i.e., the one object being created) was still being returned in the result event when I sent a GET to obtain the entire list. I could determine that by sending the result event info from the list command to the debug window:

var x:XMLList = XMLList(event.result.children());
Pomodo.debug(x);

Even though this was the result of the GET call, I was still getting the result of the POST. Again, this error appears to be within IE.

My fix (actually more of a workaround) was to add a time-generated string ("?" + Number(new Date()) ) to the end of the request URI, thus avoiding the caching problem. A better solution might be to send a "no-cache" header from the RoR portion, although I have not tested that. More on avoiding caching here:

http://www.ruby-forum.com/topic/76658
http://www.jabbypanda.com/blog/?p=16

More evil IE caching, I guess!

James Nachbar
http://www.plastic.org

Message was edited by:
nachbar, 6/14/08, to include new info, and correct that caching is occuring entirely within Flash Player/IE, and NOT within Rails, which appears to be working properly.