tags:

views:

495

answers:

3

Hi there,

I am having a problem with the loading times/size of an sifr 3 enabled site, and found out the the font swf is requested several times in my application. This can be seen in the network tab of firebug, as well as in the apache logs.

On http://novemberborn.net/flash/prefetching-movies there are some instructions for prefetching. However that does not work, the prefetch Method is not available (still in the docu!). I understand that prefetching is done automatically, however that does not seem to work.

Even in the demo page of the sifr download package, with an empty browser cache I get several hits for rockwell.swf and cochin.swf! Both with Firefox 3 and IE7...

Any chance for an easy and quick fix?

Greetings, Simon

A: 

Fundamentally, this is an issue between the browser and the Flash player. As sIFR inserts the Flash movies into the page, the browser initializes the Flash plugin with the path to the Flash movie. If the movie is not yet in a local cache, it's requested from the server. Since the movies are inserted within a few milliseconds, this would mean that a request is made for each inserted movie.

sIFR tries to prevent this by prefetching the Flash movies. It does this ones per browser session, based on a session cookie. This merely fires off a request for the movie file, and hopefully that file is in the cache by the time replacement starts. Therefore its important to load the sIFR JavaScript code as early as possible, and to activate sIFR properly by passing the Flash movies to the sIFR.activate() method.

In my experience the only way to reliably test this process is clearing browser cache, closing all browser instances (to get rid of the session cookie), then opening the browser and going straight to the page you want to test. I don't find the activity monitors within browsers reliable, so either check through an HTTP proxy or the server logs.

The one remaining improvement I could make is to try and detect the progress of the prefetch, and hold off on replacing elements until the prefetch is complete.

Mark Wubben
A: 

Do you have the option to move to Cufon? You'll find it much easier to use and isn't quirky.

kevintechie
A: 

Hi, I've the same issue and i'm stuck with it. Prefetching is not working at all on firefox 3.5 :( How sifr wiki and demo doesn't mention a solution ? Does someone have a real precise solution that works for firefox,ie and safari ? My page size is over 2Mo because of loading of my sifr swf that is 41KB requested several times :it's driving me crazy !

Luc
2MB / 41KB = 48 times...I think you are using sifr too much...
davr