一、关于H5缓存技术
提到H5缓存我们应该会想到应用缓存(application cache),只需要在标签上加一个配置<html menifest='index.appcache'>
,然后编辑对应的index.appcache,就能实现我们的缓存。
CACHE MANIFEST
# v1
CACHE:
index.html
cache.html
style.css
image1.png
# Use from network if available
NETWORK:
network.html
# Fallback content
FALLBACK:
/ fallback.html
使用应用缓存(application cache) — MDN
但是,
二、使用Service Worker实现缓存
Service_Worker_API
ServiceWorker文档
1>什么是service worker?
service worker也称服务器工作线程,是浏览器在后台独立网页运行的脚本。我们平常浏览器窗口中