Comments on: Strange Flash cache behaviour and attachMovieAnywhere solution http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/ on Flash, Java, Webdesign Sun, 04 Jan 2009 03:18:43 +0000 http://wordpress.org/?v=2.7 hourly 1 By: Madarco http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-20851 Madarco Fri, 10 Oct 2008 09:04:29 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-20851 It may depends of the kind of headers your web server is sending. You should check the cache related ones. Btw, there is a simple test in this page, it load a movieclip from a php page that log how many request the server receive. If it is green, then your client is asking for the movieclip only the first time, subsequent calls doesn't produce an http request. However, looking at the statistics of the test, sometimes it seems to fail, but I haven't isolated the cause. It may depends of the kind of headers your web server is sending.
You should check the cache related ones.

Btw, there is a simple test in this page, it load a movieclip from a php page that log how many request the server receive.
If it is green, then your client is asking for the movieclip only the first time, subsequent calls doesn’t produce an http request.

However, looking at the statistics of the test, sometimes it seems to fail, but I haven’t isolated the cause.

]]>
By: mite http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-20850 mite Tue, 07 Oct 2008 19:55:10 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-20850 Hi Madarco, Try to use Charles debugger(google it), or even apple safari debugger and you`ll see the load calls. I did a solution like yours some time ago to a project I was working, and it was very slow inside any browser(due the flash load a new file in every call). After use shared library, it speed up 200% and stop the "HTTP1/1 304 Not Modified". The only shared library problem, I think, it the need to import the externals swf reference. I think flash 9/10 can attach others swf assets without need shared object or a solution like yours. Best Regards, Mite Hi Madarco,

Try to use Charles debugger(google it), or even apple safari debugger and you`ll see the load calls.
I did a solution like yours some time ago to a project I was working, and it was very slow inside any browser(due the flash load a new file in every call).
After use shared library, it speed up 200% and stop the “HTTP1/1 304 Not Modified”.
The only shared library problem, I think, it the need to import the externals swf reference.

I think flash 9/10 can attach others swf assets without need shared object or a solution like yours.

Best Regards,
Mite

]]>
By: Madarco http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-20787 Madarco Thu, 14 Aug 2008 15:13:30 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-20787 Are you sure? Sniffing the traffic (http://www.wireshark.org/) I've see only a request per item. It will try to load an url only once, then it will take the cached item at every load attempt. Like a browser: IE, Firefox, ecc, will load an image only the first time it occurs in a page. Ps: I'm referring to Flash 8, I don't know if Flash 9 is different. Are you sure?

Sniffing the traffic (http://www.wireshark.org/) I’ve see only a request per item.

It will try to load an url only once, then it will take the cached item at every load attempt.
Like a browser: IE, Firefox, ecc, will load an image only the first time it occurs in a page.

Ps: I’m referring to Flash 8, I don’t know if Flash 9 is different.

]]>
By: mite http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-20784 mite Thu, 07 Aug 2008 05:41:27 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-20784 Hello, "Maybe because I have always thought that "loadClip" would have loaded file, maybe receiving a "HTTP1/1 304 Not Modified" reply, instead of silently take the cached one, who knows! " Well, acually it do receives a "HTTP1/1 304 Not Modified" everytime a load call is attemp. flash cannot "silently take the cached one". Aynway, Thanks. Hello,

“Maybe because I have always thought that “loadClip” would have loaded file, maybe receiving a “HTTP1/1 304 Not Modified” reply, instead of silently take the cached one, who knows!

Well, acually it do receives a “HTTP1/1 304 Not Modified” everytime a load call is attemp.
flash cannot “silently take the cached one”.

Aynway, Thanks.

]]>
By: Madarco http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-20509 Madarco Wed, 16 Jan 2008 19:46:06 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-20509 Hi, it is because attachMovieAnywhere load the movie from the net. The first time container.attachMovieAnywhere('foo.swf', 'clip', 'foo'); is executed it will load the clip from the server. This can take some time. The second time container.attachMovieAnywhere('foo.swf', 'clip', 'foo'); is executed it will take the file "foo.swf" from the browser cache, so the load will take the minimum amount of time: 1 frame. Hi,
it is because attachMovieAnywhere load the movie from the net.
The first time container.attachMovieAnywhere(’foo.swf’, ‘clip’, ‘foo’); is executed it will load the clip from the server.
This can take some time.
The second time container.attachMovieAnywhere(’foo.swf’, ‘clip’, ‘foo’); is executed it will take the file “foo.swf” from the browser cache, so the load will take the minimum amount of time: 1 frame.

]]>
By: Riccardo Bartoli http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-20508 Riccardo Bartoli Wed, 16 Jan 2008 17:41:01 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-20508 Hi Madarco, thank you for sharing this tip. I can't understand this: The main difference from attachMovie is that the attached movieclip will not be avaible until the next frame. With attachMovie the item it's attached and available in the frame where the code is scoped. How can a movieclip be available in the next frame if it's attached in the previous? Thanks a lot Hi Madarco,
thank you for sharing this tip. I can’t understand this:

The main difference from attachMovie is that the attached movieclip will not be avaible until the next frame.

With attachMovie the item it’s attached and available in the frame where the code is scoped.
How can a movieclip be available in the next frame if it’s attached in the previous?

Thanks a lot

]]>
By: Julio http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-20279 Julio Thu, 06 Dec 2007 10:24:26 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-20279 have you tried cache manager? http://www.communitymx.com/content/article.cfm?page=2&cid=827EA have you tried cache manager?

http://www.communitymx.com/content/article.cfm?page=2&cid=827EA

]]>
By: Pete http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-13736 Pete Wed, 19 Sep 2007 08:35:36 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-13736 Good stuff, thanks. Good stuff, thanks.

]]>
By: Sarah http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-8997 Sarah Fri, 06 Jul 2007 14:55:41 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-8997 Thank you! This post saved me a great deal of time trying to figure out how to cache massive movieclips. Your solution, although very simple, surprised me. I would have thought that if Flash cached files loaded by MovieClipLoader, then this code... (using the same MovieClipLoader "mcLoader" to load the same file onto the same target twice).... var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.loadClip("libraryfile.swf", target); mcLoader.loadClip("libraryfile.swf", target); ... would have worked in a similar way to the code that you provided (which uses a second MovieClipLoader "mcLoader2" and a second target "target2")... var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.loadClip("libraryfile.swf", target); var mcLoader2:MovieClipLoader = new MovieClipLoader(); mcLoader2.loadClip("libraryfile.swf", target2); ...but no! Using the same MovieClipLoader OR the same target on the second load clears the cache. I tested them all. Now that I know how this works I am very happy. Thanks again for sharing. Thank you! This post saved me a great deal of time trying to figure out how to cache massive movieclips.

Your solution, although very simple, surprised me. I would have thought that if Flash cached files loaded by MovieClipLoader, then this code… (using the same MovieClipLoader “mcLoader” to load the same file onto the same target twice)….

var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.loadClip(”libraryfile.swf”, target);
mcLoader.loadClip(”libraryfile.swf”, target);

… would have worked in a similar way to the code that you provided (which uses a second MovieClipLoader “mcLoader2″ and a second target “target2″)…

var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.loadClip(”libraryfile.swf”, target);
var mcLoader2:MovieClipLoader = new MovieClipLoader();
mcLoader2.loadClip(”libraryfile.swf”, target2);

…but no! Using the same MovieClipLoader OR the same target on the second load clears the cache. I tested them all.

Now that I know how this works I am very happy. Thanks again for sharing.

]]>
By: MAB Blog » Blog Archive » AttachMovie & Loaded Clips http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/comment-page-1/#comment-5574 MAB Blog » Blog Archive » AttachMovie & Loaded Clips Mon, 30 Apr 2007 18:18:04 +0000 http://blog.madarco.net/flash/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/#comment-5574 [...] is extremely frusterating… but after some searching today I came across this interesting link. Using the fact that Flash likes to cache everything it can, he created a function that will load [...] [...] is extremely frusterating… but after some searching today I came across this interesting link. Using the fact that Flash likes to cache everything it can, he created a function that will load [...]

]]>