Alex Rivera | Logout

Under what conditions will the browser cache <video> files?

Asked 2011-02-24T22:33:21.663
17

Under what conditions will the browser cache files? Sometimes it does, sometimes it doesn't. If no one here knows, my next step will be to test the various file format, file size, and htaccess scenarios.

If you don't know, can you think of any other variables that you'd recommend testing?

Thanks in advance!

Edit
Report

1 Answer

18

The following works to instruct the browser to cache the files. The last line was necessary to make the server deliver webm files with the correct header MIME type.

# Expires is set to a point we won't reach,
# Cache control will trigger first, 10 days after access
# 10 Days = 60s x 60m x 24hrs x 10days =  864,000
<FilesMatch "\.(webm|ogg|mp4)$">
Header set Expires "Mon, 27 Mar 2038 13:33:37 GMT"
Header set Cache-Control "max-age=864000"
</FilesMatch>
AddType video/webm .webm
answered 2011-02-28T03:34:44.543

Your Answer