-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
m4v visible in cache but browser loads it again #20
Comments
Hello! Thanks for reporting! Sounds really weird, could you provide a provide a reduced to test case so I could reproduce and try to debug it? Thank you very much! Cheers, |
Hi Jussi, This morning I double checked my .htaccess file to ensure it had all the correct cache expiry info. It looks like this: 1 WEEK<filesMatch ".(jpg|jpeg|png|gif|swf|m4v|mp4|ogv|webm|flv)$"> Code is pretty simple. I use maximizr to determine the type of video supported by the browser to do the preload. I'm on satellite internet so it really becomes apparent when things are not used from cache! I'll try to distill this down to a couple lines of working code for you. From: Jussi Kalliokoski [email protected] Hello! |
Jussi, Just learned something interesting. I was testing Safari on Mac OSX which exhibited the problem with not using cache. Firefox did the same with webm. However, Chrome works perfectly! It uses the cached videos from html5preloader and works smoothly. All browsers latest for HTML5 support. I will check iPad, iPhone, Android, and PC From: Jussi Kalliokoski [email protected] Hello! |
Thanks John, I think I have a pretty good guess of what's wrong here. First of all, you don't need to detect the supported media types, html5Preloader does it for you: myLoader.addFiles('videoname*:res/videoname.ogv||res/videoname.webm||res/videoname.m4v')
myLoader.on('finish', function () {
/* this will be the first supported video */
myLoader.getFile('videoname')
}) But that's not the cause for a double cache hit, but instead because (I presume) you create another video element in the innerHTML. Instead, you could do something like this: myLoader.on('finish', function () {
containerElement.replaceChild(
myLoader.getFile('currentclip'),
myLoader.getFile('previousclip')
)
}) Which would replace the previous clip with the already created video element. I suspect that Chrome doesn't have the issue because of its more aggressive caching. Cheers, |
Hi Jussi, I tried all the things you mentioned below and no change but the simplest case is pre-load an m4v and a png into Safari without doing anything. Looks at the stats recorded: name1318718566941.m4vradio_Checked_Med.png The m4v is never actually preloaded. The load from the From: Jussi Kalliokoski [email protected] Thanks John, I think I have a pretty good guess of what's wrong here. |
I'm really sorry for forgetting about this, I suppose you worked around it somehow? |
Hi Jussi, Never found a work-around for Safari at that time. I have not tried the latest version of Safari as I have moved on to other projects. I will be doing another jquery project soon so maybe we can explore more at that time? On Tuesday, October 15, 2013 5:25 AM, Jussi Kalliokoski [email protected] wrote: I'm really sorry for forgetting about this, I suppose you worked around it somehow? |
Using Safari 5.1.7 on OSX 10.6.8. I use html5Preloader to preload the next clip .m4v that will play. Under resources it is shown to be in cache, but when the next clip is activated, Safari goes back to the server and downloads it again. Then the preloader loads the next one into cache. Same behavior with .webm on Firefox.
The text was updated successfully, but these errors were encountered: