vasion
vasion

Reputation: 1247

how can i browser cache an image loaded dynamically in flash

I have a media player, which rotates images for the artist it plays. I load the images dynamically into the flash. The flash downloads the same images from the server over and over, how can i cache the images, so flash grabs them from a local cache and not from the server?

Upvotes: 2

Views: 1074

Answers (2)

Samuel Neff
Samuel Neff

Reputation: 74909

You can store images in a local SharedObject. By default you're limited to 100KB per site though.

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html

You can rely on the browser's own caching but even with that the browser will still make a request to the server to see if it's cache is stale, so local SharedObject caching would be better.

Upvotes: 2

mpdonadio
mpdonadio

Reputation: 2941

Flash Player relies on the browser for loading things, so you don't really need to do anything. Watch the loads in something like Live HTTP Headers in Firefox and see what the transfers look like. You may need to tweak your server to send the proper headers to allow clients to cache the images.

Upvotes: 3

Related Questions