Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有 ajax 页面浏览器的页面。在两张幻灯片上,嵌入式播放器将播放 mpeg 或 flv 视频文件。
第一次查看页面时,文件将被加载,并且在互联网连接速度较慢的情况下,它将停止启动,因为它是同时显示和加载的。
我可以在页面加载时自动缓存这两个文件,以便在访问者准备好观看它们时缓存并准备好?
兄弟。安德斯
首先,您应该注意缓存控制的 HTTP 标头。确保使用以下标头提供静态文件(使用 FireBug 进行验证):
缓存控制:max-age=3600
但是,您无法完全控制缓存,是否缓存大文件取决于 Web 浏览器。