Skip to content

支持浏览器缓存#417

Open
neveler wants to merge 4 commits intoHMCL-dev:mainfrom
neveler:cache
Open

支持浏览器缓存#417
neveler wants to merge 4 commits intoHMCL-dev:mainfrom
neveler:cache

Conversation

@neveler
Copy link
Contributor

@neveler neveler commented Mar 10, 2026

支持浏览器缓存

描述

通过为静态资源添加 hash 参数结合 service worker 实现浏览器端缓存。

改动

  1. main.css 不再用于主题的默认皮肤,默认皮肤的样式迁移至 default.css
  2. 优化 auto-link 插件,现在计算相对地址不再依赖 liquid
  3. 添加 hash_file 过滤器,用于计算目标文件的 hash {{ '/assets/js/demo.js' | hash_file }}
  4. 本地调试使用的 host 由 127.0.0.1 更改为 localhost
  5. 添加 service worker 用于缓存逻辑

https://cache-docs.hmcl.workers.dev


close #416

@neveler neveler marked this pull request as ready for review March 11, 2026 11:38
@burningtnt
Copy link
Member

一个 PR 请仅专注于一个特定的方面,不要夹杂大量更改,以免干扰 PR 审查

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.

支持浏览器缓存

2 participants