feat(pwa): 全站 PWA 化——manifest+Service Worker+图标三件
- manifest.webmanifest:standalone 双语描述、192/512/maskable 图标
(favicon.svg 经 sharp 直出)
- sw.js 保守策略:HTML network-first(不比 ESA 边缘更激进,防双重
陈旧)+ install 预缓存 16 核心路由(SSG 全站 <1MB,全站离线可读)
+ /_astro|fonts|photos 不可变 cache-first + 评论 API/CMS 绕行
- BaseLayout:manifest+双 scheme theme-color+apple-touch-icon+一次性
SW 注册(controller 守卫×VT 不重跑双保险)
- 踩坑入档:python 单线程 http.server 拖慢 16 并发预缓存,验收须等
缓存键数稳定(曾误判 install 未跑);allSettled 静默是调试黑洞,
install 失败必须探针可见
验证: 离线导航 6 页全 200(预缓存 16 条 500ms 就绪);node
tests/e2e.mjs 31/31 PASS;manifest/sw/图标三路由 200
Spec: none (PWA 基建:manifest+SW+图标,离线矩阵入档)
Co-authored-by: GLM-5.3
This commit is contained in:
1 parent
8fe9455c23
commit
a347ce8baf
6 files changed
+117
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Reference in new issue
Block a user