html中出现"wrong attribute value"告警

本文介绍了HTML5中不再推荐使用的缓存控制方式,并详细解释了如何通过使用缓存清单文件(cache.manifest)来实现资源缓存。这种方式适用于离线应用,确保网页即使在网络不可用时也能正常加载。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如图,在html中出现如上警告。

在html5之后,似乎这样的缓存控制方式不再适用。原因是,虽然各浏览器都可以对这样的方式进行处理,但是如果是代理则完全不起作用。

所以如果要缓存控制的话,建议使用如下方式:

<!DOCTYPE html>
<html manifest="cache.manifest">
。。。。

Then create cache.manifest file with content of what you want to cache i.e

CACHE MANIFEST
# 2010-06-18:v2

# Explicitly cached 'master entries'.
CACHE:
/favicon.ico
index.html
stylesheet.css
images/logo.png
scripts/main.js

# Resources that require the user to be online.
NETWORK:
*

# static.html will be served if main.py is inaccessible
# offline.jpg will be served in place of all images in images/large/
# offline.html will be served in place of all other .html files
FALLBACK:
/main.py /static.html
images/large/ images/offline.jpg



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值