I don't want Flash to store the video and image files it pulls in when I test publish the swf. Somewhere it's keeping those files in cache, making it impossible to test a realistic download situation ( such as loading indicators, buffering bars, etc ) because the 'loading' file is immediately available in its entirety due to being stored in cache.
Anyone know how to control the caching behavior?
I am using:
Adobe Flash CS5
Windows XP PRo
use the download simulator in the test environment. that's the best you can do if testing in flash.
there are many situations where that's not adequate and you should test in a more realistic environment.
Thanks, I've not used the download simulator before, nice to know about that.
The download simulator seems to work for images, but not for progressive downloadable videos. It appears that for videos I'll have to view the swf in a browser vs the standalone player after publishing it.
( It would still be nice to be able to clear the cache. Just to save a step to speed development. )
For those unfamiliar with the 'simulate download' feature, it's located under 'view' in the standalone flash player.
i don't think there is a cache for the test environment. i've certainly never had anything cached when testing there and i use the test environment routinely.
p.s. please mark helpful/correct responses.
When I'm testing the swf, I'm having it pull media off the web, not locally.
The first time the swf runs in the IDE, I see the loading indicators for the images & videos.
I may tweak some code then publish the swf again in the IDE. It's not consistent, but the second to fifth (?) publishing after the first one, the media gets stored in cache and the images and video no longer take any time to load. I close and reopen Flash IDE which sometimes solves it, and sometimes not.
Here's a clear example regarding loading a remote video file via swf published and viewed in the Flash IDE:
I publish ( with a clear cache ) and can watch the video player buffer progress bar move toward the right, indicating loading video. I close the Flash player, lets say the buffering bar indicates it has loaded 40% of the video. When I publish again, the buffer bar will start at 40% and then continue loading the rest of the video. If I let the video complete loading, and close the Flash player, the next time I publish, the buffering bar shows that 100% of the video has been loaded. The buffering bar is not a false indication as with each publishing, I can scrub to all points up to where the buffering bar indicates it has loaded.
I've tested with video files of different sizes. The most recent being 45Mb. Again, this is progressive download video.
I want to make it clear that it's not just video that gets cached, but also images. I haven't tested pulling audio into the swf, but I'm assuming it wouldn't matter what type of media it was, I would have the same results.
i wasn't aware of that.
i just checked an old thread with a response from abeall that looks promising.
using an as2 fla, add the following:
var s = new Sound();
in the error message will be a path/directory where your flash ide cache is stored.
I gave that a shot . . .which gave the output:
Error opening URL 'file:///C|/DOCUME%7E1/[User]/LOCALS%7E1/Temp/blah'
I sniffed around in that directory before but didn't see anything obvious.
I know the file size of the remote video that I'm pulling in is about 50Mb. So what I did was perform a search on the entire C: drive to find anything that was 50Mb and above. Then I would sort the results by 'Date Modified' and look for anything with a date/time stamp near the time I published the swf. Unfortunately that didn't point to anything that was obvious. In fact, the most recent time stamp of a file that size or above was 2 hours prior to publishing the swf.
When you pull content in from the Web, what type of files and how is it done? Are you testing in a browser?
If you see a "loading" bar for a video, I'd say it's being cached in a Web browser cache...
When you work "with a clear cache", how did you clear the cache?
Have you checked your Web browser cache before and after testing to see if the file is in the browser cache?
In FF you can check by typing "about:cache" in the address bar. In IE, it's a little harder in the new version but in XP you could view directly into the cache.
All that being said, I pupose you could add a time/date component to the file name so that your file always need new data, something like used in news-tickers, etc.
which requires a new time and date appended to this particular xml file, hence always requireing a new version of the file to be loaded.
Perhpas you could adapt that approach.
When I pull content from the web, it's jpg's, .flv's and .mp4's.
I'm using a Loader() to load images....and with the video's, I'll either throw an instance of FLVPlayback on stage or create one dynamically via Actionscript.
When I work with a "clear cache", it's after I close and restart the Flash IDE, though that is not consistent in clearing the cache.
In Firefox ( my default browser ), I have cache disabled. In InternetExplorer, ( not my default browser ), cache is enabled, and I had it at a limit of 50Mb. Sure enough, after I let the entire 52Mb video load in the Flash IDE, the file would show up in IE's cache. I did some testing. I deleted the file in IE's cache and then republished in Flash IDE and as expected, the video would have to reload. What's odd, is that if I let the video load to something other than 100% in the Flash IDE and then close the Flash Player, the file will not show up in IE's cache. Let's say I let the video load to 50% and then closed it. I would expect a file of 26Mb show up in IE's cache. However, nothing exists, yet when I republish in Flash IDE, the loading bar immediately starts at 50% and continues loading. It's only after letting the video load to 100% does the file appear in IE's cache. So the question now is...where did that 26Mb partial file end up?
I tested reducing IE's Temporary Internet File's "Disk Space to Use" from 50Mb down to 8Mb, the lower limig. After removing the mp4 from cache, I then published the swf in Flash IDE again, and let the video load to 100% . . .expecting that nothing would be stored in cache. However, the file reappeared in IE's cache at it's full size of 52Mb. This suggests that Flash IDE is not limited by IE's cache limit.
I've used the trick of appending a time-stamped query string to the end of a file before, which could be used as a work around, yet I'm not looking for a work around, but more interested in the Flash IDE caching question.
The standalone player and the one that runs when you test your movie from within Flash both use the cache of Internet Explorer (under Windows, don't know for mac).
So to clear the cache during developement, just start IE and clear its cache.
One thing worth to note: Standalone player can use files already stored in cache but won't save files itself. Test player from Flash will read from and save to cache.
(Sorry to dig this old thread out, but since I have the answer, it's for the sake of reference...)
That - is so pathetic on so many levels.
I can not tell you how many hours of wated time I have just dealt with - seriously Adobe - you are meant to be targeting major gaming companies, streaming media for global video, broadcast, MASSIVE corporations,
and you are cacheing files in Internet Explorer for the test environment in 2012 - you seriously need to be ashamed of yourself for something so incredibly pathetic - truly sad.
What is WORSE - I used to be able to append a random string on my fiels to overcome this, and so never noticed it before, this functionality is now broken in the test environment for some spastic reason - jesus christ.
I don't know what to say sometimes I really dont -
HOURS and HOURS of time wasted on such stupid trivial garbage -
Just so we are all clear on how incredibly pathetic this really is - let me make this clear - I load fonts, css, xml, all finds of data on load in my applications for testing - in order for me to see if anything is working - I have to open Intenent explorer, open the settings panel, open the cache, clear it, return to flash and test -
Adobe you need a serious, serious reality check - thats some ******** right there.
What's pathetic isn't neccessarily "where" they're being stored, but how.
There "where" is actually a browser-independent system cache, since the path is "AppData\Local\Microsoft\Windows\Temporary Internet Files\", and you don't have to open Internet Explorer to clear that cache. On Windows 7, just type "Temporary" in the start menu, and you'll get various links that all all go directly to the system's "Internet Properties" dialog, where you can clear the cache. Any web browser could use that cache, but 3rd party browsers tend to use their own custom path. Technically, Flash caches the files inside a "Content.IE5" subdirectory in the "Temporary Internet Files" folder, which I believe is some kind of legacy folder indicating the player is using some old or built-in system APIs for the loading and caching. See my post here: http://stackoverflow.com/a/12483776/88409
Now... the HOW is what's pathetic. However it is caching files, it's wrong. It's not properly checking for updated files on the server, and it's a mystery what API is doing to loading and what, if any, settings there are on how often to check for an updated file. As far as I can see, it doesn't check at all, even after a dozen times. Furthermore, I load files with a random query string appended to the filename like "?random=9384934×tamp=89849539", so every single request should be treated as a new file and therefore should not be loaded from the cache at all. Ultimately, it is pathetic, because the caching is undocumented, unpredictable, and incorrect.
This is why people don't pay for software. There are so many hours wasted troubleshooting undocumented and broken features, that by the time we're done providing our own support and wasting so much time, Adobe should owe us money. For every week I spend coding, I have to spend 3 months troubleshooting $hit like this.
Europe, Middle East and Africa