We developed a site similar to YouTube...however there is a problem. When a viewer selects a video then selects another video the player, plays previous video. The title and description are correct but the video is always the previous video. I appears that
Internet Explorer caches videos. Using the Firefox browser on my workstation, I was unable to reproduce the "duplicate video" problem that I was viewing with Internet Explorer.
Is there code that would affect the way Internet Explorer caches video content?
Could this be an html issue not a php issue?
How can we fix this issue?
Internet Explorer caches videos
Started by Ray, Nov 12 2008 08:54 AM
3 replies to this topic
#1
Posted 12 November 2008 - 08:54 AM
|
|
|
#2
Guest_Jordan_*
Posted 12 November 2008 - 10:27 AM
Guest_Jordan_*
First I'd have to ask how you are presenting the videos to the user?
One way to get around browser caching is to create a random number and attach an arbitrary value to the URL. For example, if you look at CodeCall Programming (homepage) the images there are randomly selected via PHP. Normally it would display the same image for all three segments but I created a random number and attached it as I explained above. The image URL looks like this:
The random number causes browser to load the content as new content. Not sure if this will help you in your case though.
One way to get around browser caching is to create a random number and attach an arbitrary value to the URL. For example, if you look at CodeCall Programming (homepage) the images there are randomly selected via PHP. Normally it would display the same image for all three segments but I created a random number and attached it as I explained above. The image URL looks like this:
http://www.codecall....p?value=<Random Number>
The random number causes browser to load the content as new content. Not sure if this will help you in your case though.
#3
Posted 12 November 2008 - 01:03 PM
currently the video is presented like this
/index.php?file=pages/final_video&id=165
what should change here and should this be done for all videos?
/index.php?file=pages/final_video&id=165
what should change here and should this be done for all videos?
#4
Guest_Jordan_*
Posted 12 November 2008 - 05:50 PM
Guest_Jordan_*
You could implement what I stated above. Attach the random number like this:
For example:
You can use the PHP rand() function attach this and yes, it should be done to all videos and should change each time the video is called. This may not be the best method but it works well for images.
Another method may be to look at the header() output and disable caching. We use this in our community project ionFiles to prevent file caching:
/index.php?file=pages/final_video&id=165&<argument>=<random number>
For example:
/index.php?file=pages/final_video&id=165&random=902436787
You can use the PHP rand() function attach this and yes, it should be done to all videos and should change each time the video is called. This may not be the best method but it works well for images.
Another method may be to look at the header() output and disable caching. We use this in our community project ionFiles to prevent file caching:
header("Pragma:no-cache");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");


Sign In
Create Account

Back to top









