Skip to content

docs: 修正 BINARY_CACHE 注释(实际无 TTL/上限、weigher 未生效)#73

Merged
wnzzer merged 1 commit into
mainfrom
docs/binary-cache-comment
May 29, 2026
Merged

docs: 修正 BINARY_CACHE 注释(实际无 TTL/上限、weigher 未生效)#73
wnzzer merged 1 commit into
mainfrom
docs/binary-cache-comment

Conversation

@wnzzer
Copy link
Copy Markdown
Owner

@wnzzer wnzzer commented May 29, 2026

Summary

  • asset.rsBINARY_CACHE 原注释写"weighted size-based eviction (still useful)",与实现不符:builder 设了 weigher没有 max_capacity,moka 只有在配了 max_capacity 时才按权重驱逐 → 当前永不过期、永不驱逐,weigher 形同虚设。
  • 仅改注释,准确描述:无 TTL / 无上限 / 进程内常驻,并说明如何激活容量上限。无行为变更。

背景

排查"图标偶发不显示"时确认:图标闪烁仅来自冷启动缓存填充窗口,与缓存淘汰无关(因为根本不淘汰)。顺手把误导性注释修正。

Test plan

  • cargo fmt --check 通过
  • cargo clippy --all-targets --all-features -Dwarnings 通过
  • 注释级改动,无逻辑变化

Copilot AI review requested due to automatic review settings May 29, 2026 16:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR corrects misleading documentation around the Tauri asset binary cache so the comment matches the current moka cache configuration and runtime behavior.

Changes:

  • Clarifies that BINARY_CACHE has no TTL or capacity limit.
  • Notes that the configured weigher is inactive unless max_capacity is added.
  • Documents the tradeoff of enabling capacity-based eviction later.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wnzzer wnzzer merged commit 5a6d0f9 into main May 29, 2026
4 checks passed
@wnzzer wnzzer deleted the docs/binary-cache-comment branch May 29, 2026 17:21
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