Much better approach!

Now, my question is, what do people do to prevent caching of swf files
themselves?

Here's the setup: I'm deploying a business app, and want all users to see
the update to the SWF. However, I don't want to tell everyone to clear their
cache. Should I just pass a version number to the swf request, to update to
that point, ie - point to:

$vers = "1.0.2";

$path = "/flash/myMovie.swf?vers=" . $vers;

<object file=$path>...etc.

Is there a best practice for this kind of thing? I'm also curious how this
will apply to Module development in Flex. How do I make sure that people
have current modules, without blasting their cache, every time?

Thanks,

-Scott


On 3/14/07, Thomas Fowler <[EMAIL PROTECTED]> wrote:

I'm sure someone has already mentioned this but you could always append
the
date in milliseconds to the query string as well.

Like so:

var date : Date = new Date();

url:String = resource + "?d=" + date.UTC();

----- Original Message -----
From: "slangeberg" < [EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>; "Flashcoders mailing list"
<flashcoders@chattyfig.figleaf.com >
Sent: Wednesday, March 14, 2007 10:52 AM
Subject: [Flashcoders] Re: [flexcoders] Re: Caching problem

> That'll work with any cache-busting you need to do. I use it in testing,
> to
> un-cache the swf file itself, when viewed on server. Ie: send rand var
in
> url and if it's present, pass it in to swf call (swfobject + php, here):
>
> var so = new SWFObject( "ProductBuilder.swf?rand=<?=$rand?>",
> "product_builder", "100%", "100%", "9", "#FFFFFF");
>
> Saves me the 'pain' of going through some menu to clear browser's cache,
> not
> to mention losing your browser's cache, in order to update one element!
>
> -Scott
>
> On 14 Mar 2007 08:44:42 -0700, Alex <[EMAIL PROTECTED]> wrote:
>>
>>   Wow! O_O' Works flawlessly!! :-D
>>
>> Many thanks for that trick dude!
>>
>> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>,
>> slangeberg <[EMAIL PROTECTED]> wrote:
>> >
>> > With Flash, I've learned to do the lo-tech method of attaching
>> random
>> > numbers to the path. Simple, but it's been effective!:
>> >
>> > url:String = resource + "?rand=" + Math.floor(Math.random() *
>> 100000);
>> >
>> > -Scott
>> >
>> > On 14 Mar 2007 08:07:52 -0700, Alex <[EMAIL PROTECTED]> wrote:
>> > >
>> > > Hi there!
>> > >
>> > > I have an xml file that needs to be loaded eventually using a
>> > > URLRequest. I'm trying to avoid loading a cached file using these
>> > > headers:
>> > >
>> > > urlRequest.requestHeaders.push(new URLRequestHeader("Cache-
>> > > Control", "no-cache, no-store, max-age=0, must-revalidate"));
>> > > urlRequest.requestHeaders.push(new URLRequestHeader
>> > > ("Expires", "Fri, 30 Oct 1998 14:19:41 GMT"));
>> > > urlRequest.requestHeaders.push(new URLRequestHeader
>> > > ("Pragma", "no-cache"));
>> > >
>> > > It works ok in firefox and IE6.0.2900 , but I still obtain a
>> cached file
>> > > in IE6.0.3790+ and IE7.
>> > >
>> > > Do I need to add any more headers? or what's the problem here?
>> > >
>> > > Thanks in advance
>> > >
>> > >
>> > >
>> >
>> >
>> >
>> > --
>> >
>> > : : ) Scott
>> >
>>
>> >>
>
>
>
> --
>
> : : ) Scott
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--

: : ) Scott

--

: : ) Scott

Reply via email to