PDA

View Full Version : Is downloads with URLLoader cached?



Zomis
January 24th, 2008, 04:35 PM
I use URLLoader to get some data from some PHP Scripts on my site. However, even though I KNOW that the output from the PHP Script has changed, the URLLoader still fetches the same data, so I am wondering: Is the URLLoader downloads cached in Flash Player somehow, and is there some way to prevent this from happening?

Sirisian
January 24th, 2008, 04:42 PM
in the <head> tag, put: <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

http://support.microsoft.com/kb/222064

I just asked someone on IRC and they told me that. Hope it helps you.

Zomis
January 24th, 2008, 04:50 PM
The problem is, I'm using this:

var loader2:URLLoader = new URLLoader();
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
This tells Flash player that it's expecting output in the form of a bunch of variable names and values grouped, such as this (which is a part of the output I receive from the PHP script)


id593=593,2008-01-24 21:27:28,Zomis,26,#AI Hard,25,113&id592=592,2008-01-24 18:43:50,Player1,26,#AI Hard,17,89&id591=591,2008-01-24 15:27:28,Player1,26,#AI Hard,18,78&id590=590,2008-01-24 15:25:23,Player1,26,#AI Hard,25,127&id589=589,2008-01-24 15:23:05,Etrisa,13,#AI Complete Idiot,0,19&id588=588,2008-01-24 15:22:24,Etrisa,1,#AI Complete Idiot,0,3&id587=587,2008-01-24 15:22:12,Etrisa,1,#AI Hard,0,5&id586=586,2008-01-24 15:19:20,Etrisa,21,#AI Complete Idiot,4,39&id585=585,2008-01-24 15:18:46,Player1,2,#AI Hard,0,4
That is, if I add a <HEAD> tag and that stuff, then Flash Player will give me an error saying that it's not a correctly encoded string.

Felixz
January 25th, 2008, 12:40 PM
All files loaded via loader/URLLoader are stroed in Temporary Internet Files folder

Zomis
January 25th, 2008, 12:47 PM
Argh... is there any way to prevent that?

Felixz
January 26th, 2008, 09:10 PM
I have found that in BulkLoader class by Arthur Debert

if (preventCache){
var cacheString : String = "BulkLoaderNoCache=" + int(Math.random() * 100 * getTimer());
if(url.url.indexOf("?") == -1){
url.url += "?" + cacheString;
}else{
url.url += "&" + cacheString;
}
}