RSS
 

Image cache and Adobe Flex

20 Apr

Okay, I kept running into the headache of images being cached within my flex application. I found a simple workaround, appending a URL parameter of the current time to the image’s path.

For example, the path img/simple.jpg becomes img/simple.jpg?date=12010103. Each time the page is refreshed, a new date parameter is generated, fixing our cache headache.

The flex code

url + "?d=" + (new Date()).getMilliseconds();

And the php code

$url . "?d=" . date("U");

Those two small take care of the images being cached.

 
No Comments

Posted in RIA

 

Leave a Reply

 

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word