


Webkit's Research on Application Cache Implementation of HTML 5_html/css_WEB-ITnose
Due to work, I have been studying ApplicationCache for a while. First, let’s introduce some basic concepts of SQL DB Table related to it,
For more introduction, please refer to the article from w3school.com.cn:
Using HTML5, through Create a cache manifest file to easily create an offline version of your web application.
What is Application Cache?
HTML5 introduces application caching, which means web applications can be cached and accessed without an Internet connection.
Application caching brings three benefits to apps:
Browser Support
Application caching is supported by all major browsers except Internet Explorer.
HTML5 Cache Manifest Example
The following example shows an HTML document with cache manifest (for offline browsing):
Example
<!DOCTYPE HTML><html manifest="demo.appcache"><body>The content of the document......</body></html>
Try it yourself
Cache Manifest Basics
To enable application caching, include the manifest in the document's tag Attributes:
<!DOCTYPE HTML><html manifest="demo.appcache">...</html>
Each page with a specified manifest will be cached when the user accesses it. If the manifest attribute is not specified, the page will not be cached (unless it is specified directly in the manifest file).
The recommended file extension for manifest files is: ".appcache".
Please note that the manifest file needs to be configured with the correct MIME-type, i.e. "text/cache-manifest". Must be configured on the web server.
Manifest file
Manifest files are simple text files that tell the browser what is cached (and what is not cached).
The manifest file can be divided into three parts:
CACHE MANIFEST
The first line, CACHE MANIFEST, is required:
CACHE MANIFEST/theme.css/logo.gif/main.js
The manifest file above lists three resources: a CSS file, a GIF image, and a JavaScript document. When the manifest file loads, the browser downloads these three files from the root directory of the website. Then, whenever the user disconnects from the Internet, these resources are still available.
NETWORK
The following NETWORK section specifies that the file "login.asp" will never be cached and is not available offline:
NETWORK:login.asp
You can use Star number to indicate that all other resources/files require an Internet connection:
NETWORK:*
FALLBACK
The FALLBACK subsection below specifies that if an Internet connection cannot be established, "offline.html" is used instead of /html5 / All files in the directory:
FALLBACK:/html5/ /404.html
Note: The first URI is the resource, the second is the fallback.
Update cache
Once an app is cached, it remains cached until:
实例 - 完整的 Manifest 文件
CACHE MANIFEST# 2012-02-21 v1.0.0/theme.css/logo.gif/main.jsNETWORK:login.aspFALLBACK:/html5/ /404.html
重要的提示:以 "#" 开头的是注释行,但也可满足其他用途。应用的缓存会在其 manifest 文件更改时被更新。如果您编辑了一幅图片,或者修改了一个 JavaScript 函数,这些改变都不会被重新缓存。更新注释行中的日期和版本号是一种使浏览器重新缓存文件的办法。
关于应用程序缓存的注释
请留心缓存的内容。
一旦文件被缓存,则浏览器会继续展示已缓存的版本,即使您修改了服务器上的文件。为了确保浏览器更新缓存,您需要更新 manifest 文件。
注释:浏览器对缓存数据的容量限制可能不太一样(某些浏览器设置的限制是每个站点 5MB)。

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...
