在什么条件下会在浏览器缓存<视频>文件? [英] Under what conditions will the browser cache <video> files?

查看:277
本文介绍了在什么条件下会在浏览器缓存<视频>文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在什么条件下将浏览器的缓存文件?有时它,有时它没有。如果这里没有人知道,我的下一个步骤将是测试各种文件格式,文件大小,和htaccess的场景。

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?

在此先感谢!

推荐答案

下面的工作指示浏览器缓存中的文件。最后一行是必须使服务器递送WEBM文件具有正确的标题MIME类型。

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

这篇关于在什么条件下会在浏览器缓存&LT;视频&GT;文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆