Ok I have looked into how to stop browsers from storing a video in its cache once watched. So I moved to check out my script in IE and found that the video was in the cache not matter what I did. So I looked into this and found that IE does not allow the header feature to disable its cache of a video. BUT it does allow you to change how long the video is in the cache before being deleted.
So if I was to through time limit in the header of a video being played through php could I some what stop the issue with IE?
Like say the video is 1 min long and I changed the limit to like 1 min and 30 sec or something.
Has anybody ever looked into something like this when showing movie files though php using headers?
Thanks
justin
preventing IE from Cacheing video's?
Moderator: General Moderators
Re: preventing IE from Cacheing video's?
You can't even stop a wmv from being hotlinked in any browser. The solution is to alter the URL such that you generate a unique token and then serve the video thru the PHP script. Without a valid token you will assume its a hotlink request. Due to the URL changing with the token it will not be cached either.
Re: preventing IE from Cacheing video's?
Yea thats what I have done
pretty much I did this
uploaded a video through my script putting it in a protected folder. then assigns the video a Key 10 Chars long and stores the realvideo location along with the Key in a MySQL DB. When the link streamvideo.php?ID=abcdefg is used the streamvideo.php scripts $_GET (s) the key and queries the database looking for the key and then serving the real Location of the video to PHP and I use readfile() to get the contents of the video.
I added header()'s to stop cache of them in most browsers. IE does not follow the no-cache rule. ( verified through microsoft )
but it does honor the time limit for storing the cache.
I also added a .htaccess file to the default video DIR "deny from all" and then "allow from ***.***.**.**" which stops hot linking. I also added some sessions to the streamvideo.php file.
My question was. Can I use a header to limit the time the video stays in the Cache for IE while at the same time using the no-cache for all the other broswers?
pretty much I did this
uploaded a video through my script putting it in a protected folder. then assigns the video a Key 10 Chars long and stores the realvideo location along with the Key in a MySQL DB. When the link streamvideo.php?ID=abcdefg is used the streamvideo.php scripts $_GET (s) the key and queries the database looking for the key and then serving the real Location of the video to PHP and I use readfile() to get the contents of the video.
I added header()'s to stop cache of them in most browsers. IE does not follow the no-cache rule. ( verified through microsoft )
but it does honor the time limit for storing the cache.
I also added a .htaccess file to the default video DIR "deny from all" and then "allow from ***.***.**.**" which stops hot linking. I also added some sessions to the streamvideo.php file.
My question was. Can I use a header to limit the time the video stays in the Cache for IE while at the same time using the no-cache for all the other broswers?
Re: preventing IE from Cacheing video's?
That is not a solid approach to stop all hotlinking.myister wrote:I also added a .htaccess file to the default video DIR "deny from all" and then "allow from ***.***.**.**" which stops hot linking. I also added some sessions to the streamvideo.php file.
I don't see why not. Just pass both headers.My question was. Can I use a header to limit the time the video stays in the Cache for IE while at the same time using the no-cache for all the other broswers?
Re: preventing IE from Cacheing video's?
I am going to try to do the both header thing and see how that works.
What other way could I stop direct hotlinking if the real DIR that holds all the real movies was found?That is not a solid approach to stop all hotlinking.
Re: preventing IE from Cacheing video's?
Like I said, create a token and pass it in the URL. Only allow one request per token, so someone could hotlink a video but they would have to go thru a greater ordeal (scraping the page to get valid tokens each time)