回复内容:
别想了,manifest的目的是离线运行,如果宿主html文件不被manifest自动缓存的话,整个离线运行最基本的html都跑不起来。实在要用manifest,就将宿主html文件也添加进manifest清单中,然后在每次侦测到清单内容更新完毕后,提示用户并reload一次页面就好了。
自动二次刷新代码:Html5之离线Web应用程序
manifest相关的另外一篇回答:关于前端缓存优化,为什么没人用manifest? - 黎博的回答 manifest是很坑爹的,名字叫Application Cache就已经很好的定性了,它是用来构造离线应用程序的。比方说你写了个秒表,它离线也能用,这是manifest的应用场景。
然而天真的人类想只用manifest来缓存资源文件而不缓存页面,W3C那群老头怎么可能会向如此接地气的工业需求妥协,所以这是不可能的。
于是你发现manifest只会让你的用户优先看到旧的页面,即使你能响应update事件,但你要在这里强刷一次的话,交互和产品经理多半是会拎着刀来。而如果你在这里不刷新的话,请设想一下运营知道她上了一个节日banner却需要页面第二次打开才能看到的心情。 可以这样曲线处理
1.HTML body内容为空
2.HTML文件中引用一个不被 cache 的脚本文件,这个脚本文件来写html
-----------
其实,并没有什么意义,毕竟,application cache 的作用是 离线访问 更新不过来资源啊,具体要怎么来更新呢?求助... 我也在搞这个 还是找不到怎么搞 一直没找到解决方案

This article explains how to embed audio in HTML5 using the <audio> element, including best practices for format selection (MP3, Ogg Vorbis), file optimization, and JavaScript control for playback. It emphasizes using multiple audio f

This article explains how to create and validate HTML5 forms. It details the <form> element, input types (text, email, number, etc.), and attributes (required, pattern, min, max). The advantages of HTML5 forms over older methods, incl

The article discusses using the HTML5 Page Visibility API to detect page visibility, improve user experience, and optimize resource usage. Key aspects include pausing media, reducing CPU load, and managing analytics based on visibility changes.

The article discusses using viewport meta tags to control page scaling on mobile devices, focusing on settings like width and initial-scale for optimal responsiveness and performance.Character count: 159

The article discusses managing user location privacy and permissions using the Geolocation API, emphasizing best practices for requesting permissions, ensuring data security, and complying with privacy laws.

This article details creating interactive HTML5 games using JavaScript. It covers game design, HTML structure, CSS styling, JavaScript logic (including event handling and animation), and audio integration. Essential JavaScript libraries (Phaser, Pi

The article explains how to use the HTML5 Drag and Drop API to create interactive user interfaces, detailing steps to make elements draggable, handle key events, and enhance user experience with custom feedback. It also discusses common pitfalls to a

This article explains the HTML5 WebSockets API for real-time, bidirectional client-server communication. It details client-side (JavaScript) and server-side (Python/Flask) implementations, addressing challenges like scalability, state management, an


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
