This content has been marked as final. Show 13 replies
If you're reading the timecode from the text file you could try appending the value you read to the mp3 url you request each time, which should maximise use of the local cache copy depending on the users browser settings.
where the timecode variable is the timecode you loaded previously.
I did this recently with an xml file that was being updated on the server by appending a random number to avoid the browser cache. In your case, you want to keep using the cached version unless the timecode changes so I think this should work so long as the name of the mp3 file is not altered for subsequent requests.
See this I've already done because good old internet explorer automatically tries to play from it's cache and for some reason doesn't work when it does this so i'm ahving to stick the a random number at the end of the url so it always looks for a new one and this is why i need the flash to cache it not the browser. I want the SWF to do the work not the browser or the Server...........is it possible?
I'm pretty sure you can't get flash to do that. The only thing you can save are local SharedObjects.
I haven't tried what you're trying to do which is prefer the local cache on designated occasions, by using an appended identical parameter. I've always done it with random parameters to try to avoid the cache. But it was the only thing I could think of sorry.
Any chance you could have a different filename of the mp3 whenever it changes on the server side... and have that loaded from the textfile? As well as the timecode if you need it.
to clarify my last post: if the appended parameter seems to force a download even if its identical to the last time... then maybe avoid the need to use the appended parameter. Or is this the "server doing the work" that you referred to in your last post?
Yeah basically i think you're almost as confused as me! We need the server to do as little work as possible because we have a lot of users, the appended parameter on the URL forces the browser to always go to the server so we cant do that but internet explorer doesnt work when it plays it's cached files so we cant do that, so this is the only thing we've come up with. I found this on the knowledge base
saving files locally
which may work but i really dont want to be dumping things on users computers as i hate it when sites do that to me!
cheers for trying though
I am frequently confused. But I do understand what you want to do even if I don't have the answer. I don't think Central will help you as I'm pretty sure its a little different to flash and I think its been superseded by Apollo very recently.
I can't understand why the URL request with the identical parameter would not maximise use of local browser caches. This is not from experience unfortunately.. just the observation that people go to great (well maybe not great) lengths to provider random parameters to avoid cacheing ... in other words ensuring that they use different parameters each time to force a new load from the server. Beyond that the individual browser settings of different users of IE or firefox etc will always presumably have an effect.
In the absence of a solution for you, all I can suggest is trying something a little weird and maybe using LoadVars to "load" your mp3 and see if it works differently. I have no idea if it might help. I'd never heard of this before but read about it just now here:
don't append a random number to your mp3's file name. just append the time code (or some part of it) so the mp3 name stays the same unless the time code changes.
Do you mean what I put in my first post..? He said he already tried that.
Can you post the actionscript loadVars code that reads the timeCode from the text file ...? Oh and for reading the text file... for that you probably do want to append a random number or getTimer code. You want to d/l the text file each time for sure and don't want that to load from the cache.
Try using trace on the timecode that you append to the URL for the mp3 and make sure its correct.
The only other thing I can think of (and please don't take offence, just trying to eliminate everything): For the testing you're doing, what are the browser cache settings?
he may have said he tried it, but that wouldn't make sense. if a browser encounters two files have the same name (with an appended string or without an appended string), the 2nd encountered file will be retrieved from the user's cache.
Thanks. That's what I thought too... and all I could think of beyond that was what I put in my last post... i.e. for some reason the appended string is getting a different value every time or... the browser cache settings on the test machine are set to always check the server.
Thanks for all the replies guys I've been away from my desk all weekend hence not replying!
I will post up the code of getting the timecode as soon as I've written it as I'm currently doing it a slightly different way.
In response the browser cache settings i don't want to touch them as what I've made is to be rolled out to the public and i don't want to make regular users mess around with their settings, so that rules that out.