[英]If a file is listed in a cache manifest but not placed into the page's document, will it be cached?
I have a bunch of files listed in a cache manifest
. 我在缓存manifest
列出了一堆文件。 Firefox's network tab shows the page being loaded and cached but the files listed do not show ever being loaded or cached. Firefox的“网络”选项卡显示正在加载和缓存的页面,但列出的文件从未显示过加载或缓存。 They are not added to the page until someone clicks a proper button and then they (videos) are placed into the document and loaded by JavaScript. 除非有人单击适当的按钮,然后将它们(视频)放入文档中并由JavaScript加载,否则它们不会添加到页面中。
Will all the HTML5 compliant browsers still cache all files in a manifest, or do they need to be added to the document at load time? 是否所有兼容HTML5的浏览器仍将所有文件缓存在清单中,还是需要在加载时将它们添加到文档中?
MANIFEST 表现
CACHE MANIFEST
# Manifest last updated: 2015-09-13 13:05:31
CACHE:
stylesheets/desktop.css
stylesheets/tablet.css
scripts/script.js
videos/test.mp4
MAIN PAGE CALL TO MANIFEST 要显示的主页面调用
<!DOCTYPE html>
<html manifest="manifest.appcache">
The video is inserted in JavaScript when the user clicks to play it. 用户单击播放视频时,该视频将插入到JavaScript中。 Do I need to add it to the page during load to make it cached? 加载期间是否需要将其添加到页面中以使其被缓存?
The browser will cache any file in a manifest whenever that file is first requested. 每当首次请求该文件时,浏览器就会在清单中缓存该文件。 Files in manifests don't need to be loaded at the time of the document load event. 清单加载中的文件不需要在文档加载事件时加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.