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
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "wait4x",
|
||||
"short_name": "wait4x",
|
||||
"description": "wait4x 的个人博客:阅读、技术与摄影",
|
||||
"lang": "zh-CN",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#191d23",
|
||||
"theme_color": "#191d23",
|
||||
"icons": [
|
||||
{ "src": "/icons/icon-192.png", "sizes": "192x192", "type": "image/png" },
|
||||
{ "src": "/icons/icon-512.png", "sizes": "512x512", "type": "image/png" },
|
||||
{ "src": "/icons/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user