html – Caching videos on client browser? – Education Career Blog

I want to stream video from my web server (might be google app engine, or amazon simple storage). I’m curious if browsers can somehow cache a video. My site will often have users playing the same video over and over again, and I’m wondering if I can hint the browser to just cache videos from my site so the user isn’t constantly streaming (thus, reducing my operating costs).

Is there some way to do this? I haven’t picked a streaming video player yet, not sure if that factors into this,



You can theoretically use HTML5’s offline manifest file to cache the video, but I’ve read in numerous places that browsers have undocumented data caps that make this almost entirely unreliable.

Your other bet is to use Flash to store the data (totally do-able, but seriously) and then use a data URL to access it through JS. This is ugly, terrible, and you’ll go to hell three times over for it.

Regardless, if you’re streaming the video in the traditional sense (as with Amazon Cloudfront Streaming Endpoints), you can’t cache the video: it’s streaming! Streaming content cannot be cached (reasonably). Most of the time, folks use “fake” streaming from PHP to accomplish this. It’s not streaming in the traditional sense of the word, but it functions pretty well.

Anyway, if you’re using HTML5 video tags, the browser may do some caching for you (in which case you’re set), but otherwise, I’m afraid you’re out of luck.

Hope this helps!

Leave a Comment