Skip to content

⚡️ perf(runtime): cache static page-load script data#1502

Closed
cyfung1031 wants to merge 1 commit into
mainfrom
pr/static-page-load-script-data/001
Closed

⚡️ perf(runtime): cache static page-load script data#1502
cyfung1031 wants to merge 1 commit into
mainfrom
pr/static-page-load-script-data/001

Conversation

@cyfung1031

@cyfung1031 cyfung1031 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

主要是把 #1404 中某部份拆出来,然后关掉 #1404.
( #1404 有点过度复杂 )


Also fix named file:// @resource refresh by checking the parsed resource path.

Checklist / 检查清单

  • Fixes mentioned issues / 修复已提及的问题
  • Code reviewed by human / 代码通过人工检查
  • Changes tested / 已完成测试

Description / 描述

核心改动:

  • RuntimeService.getScriptsForTab 增加页面加载专用静态资料缓存。
  • 缓存 compiled resource、resource、script code、metadata/userConfig 字串和解析结果、URL patterns。
  • value.getScriptValue 仍每次页面加载重新读取,不进入缓存。
  • install/update/delete/enable/disable/sort、blacklist、全局启停等路径保守清理缓存。
  • 本地 file:/// resource 命中缓存时仍逐次刷新;hash 变化才更新返回 resource 和已注册 userScript。
  • 修复命名 @resource asset file:///... 使用原始整行判断导致无法热刷新的问题,改为判断解析后的路径。

新增/调整测试:

  • 静态资料复用与 value 实时性。
  • value 更新后下一次页面加载返回新值。
  • 部分缓存命中时顺序稳定。
  • run-in / noframes 过滤后顺序稳定。
  • 全局停用、blacklist、无匹配、disabled、自定义 exclude 等页面过滤语义。
  • @require file:///...@require-css file:///...、命名 @resource file:///... 热刷新和 userScript 更新。

Screenshots / 截图

Also fix named file:// @resource refresh by checking the parsed resource path.
@cyfung1031

Copy link
Copy Markdown
Collaborator Author

我用 Fable 5 重新写了一份Spec去研究到底 1404 要如何重写了。(目前 1404 和 1502 都不太理想。需砍掉重做)

@cyfung1031 cyfung1031 closed this Jun 12, 2026
@CodFrm CodFrm deleted the pr/static-page-load-script-data/001 branch June 12, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant