PDA

View Full Version : Using LzView SWF/MP3 caching - How?


kmeixner
04-17-2008, 09:58 AM
Hello,

I am trying to figure out how to use caching for SWF video and MP3 audio downloaded via a URL in an OpenLaszlo application during runtime. I am using OpenLaszlo 3.3.3 with an application compiled in proxied mode to SWF8.

Basically, in my application I often need to reload the same large video or large audio file (from a URL) into multiple views in the application simultaneously and I would like to avoid having to reload the entire media item into memory after it is loaded once.

Right now it seems to load an instance of the media item into the application for every view it is displayed in -- taking the same amount of time to load the second time as the first time. I thought that by turning caching on it would load the media item once and then have it available in memory for re-use if the same media item is set as the resource of another view but this does not seem to be the case.

On the client side, I load all media items into the LzView class with the setSource() method and cache set to 'both' (client and server).

I also attempted to configure the lps/config/lps.properties file by uncommenting the mcache.directory, mcache.disk.size and mcache.mem.size but then when I tried to reload the same item twice the application would hang. Maybe this needs to be working to solve my problem? (any help getting this to work would be appreciated)

If anyone can tell me how to have multiple views of the same resource loaded from a URL (determined during runtime) without loading two copies of the media item into memory it would be greatly appreciated.

Thanks,

Kevin

rcyeager
04-17-2008, 11:05 AM
Caching behavior is most often controlled by the browser and the response headers from the target web server.

Here is a recent thread that dealt with image caching:

http://forum.openlaszlo.org/showthread.php?t=11542&highlight=image+cache

It doesn't help that very little information is documented about the cache setting on the setSource() method. I could be wrong, but I believe that setting only deals with image transcoding, to help prevent repetitive transcoding done at runtime by the LPS server. The mcache is a cache of transcoded runtime media (images). As such, media that doesn't get transcoded, like MP3 and FLA, wouldn't be involved with the mcache and that setSource() cache setting. This is all based on my experience working with OL, so again I could be wrong about this.

I suggest troubleshooting the problem at the browser and web server level, as opposed to thinking that OpenLaszlo itself is causing the problem. In most every cache issue I have troubleshooted in the past, the solution was to be found somewhere with the response headers. Using a low-level IP traffic tool such as HttpWatch w/ IE will probably be needed to help understand what happens when the browser performs the media requests, so you can figure out why it doesn't retrieve items from the browser cache when available.

Robert
http://www.qrowd.com
http://www.cooqy.com

kmeixner
04-17-2008, 11:48 AM
Thanks for the response Robert, I'll take a look at the post you linked and what is going on at the browser/web server level as you suggest.

Kevin

rcyeager
04-17-2008, 12:27 PM
If you reach a dead end, post a sample program that demonstrates the issue and I will try to help find the problem.

Robert
http://www.qrowd.com
http://www.cooqy.com