简体   繁体   English

如果文件在缓存清单中列出但未放入页面文档中,是否将其缓存?

[英]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.

相关问题 是否可以在使用cache.manifest缓存的文件上使用jquery getScript - Is it possible to use jquery getScript on a file that is cached with a cache.manifest HTML5缓存清单文件本身不被缓存,而是在每次资源加载时调用 - HTML5 Cache manifest file itself is not cached, and called at each resource load 如何推迟W3 Total Cache的缓存和缩小的javascript文件的javascript解析 - How to defer parsing of javascript of W3 Total Cache's cached & minified javascript file 动态触发HTML5缓存清单文件? - Dynamically Trigger HTML5 Cache Manifest file? HTML 5存储应用程序缓存清单文件位置 - HTML 5 Storage Application Cache Manifest file location 为什么必须将$(document).on(..)放置在页面上的任何位置,而必须将$(“。cl”)。on(..)放置在$(document).ready回调中或之后 <body> ? - Why can $(document).on(..) be placed anywhere on a page while $(“.cl”).on(..) has to be placed in the $(document).ready callback or after the <body>? 在缓存应用程序(缓存清单)之前,是否必须打开iOS webapp? - Do I have to open a iOS webapp before the app is cached (cache manifest)? 使用html 5缓存清单时如何以编程方式更新页面服务器端而不更改缓存清单? - How to update programatically a page server side when using html 5 cache manifest without changing cache manifest? 页面加载时随机放置的 div - Randomly placed div's at page load 将缓存页面检查集成到索引文件中 - integrate cached-page check into index file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM