Skip to main content

implement-client-side-caching

Implement client-side caching with explicit ownership, freshness, invalidation, isolation, and recovery. Use when browser data reuse can improve latency or resilience without misleading users.

来源信息

仓库
protosphinx/sphinxstack
最近来源活动
2026年7月29日 13:55
检测到的 SKILL.md 语言
英语
星标
3
Forks
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
implement-client-side-caching
category
web
description
Implement client-side caching with explicit ownership, freshness, invalidation, isolation, and recovery. Use when browser data reuse can improve latency or resilience without misleading users.
# implement-client-side-caching Cache only data whose stale and cross-session behavior is understood. ## Procedure 1. Inventory candidate data, owner, sensitivity, size, update rate, and freshness contract. 2. Choose memory, HTTP, service-worker, or persistent storage by lifecycle and trust boundary. 3. Define cache key, account, tenant, locale, version, and authorization dimensions. 4. Set freshness, stale use, revalidation, invalidation, eviction, and quota behavior. 5. Prevent older responses and concurrent mutations from overwriting newer state. 6. Clear or partition data on logout, account switch, permission change, and schema migration. 7. Expose stale, refreshing, offline, conflict, and failure states honestly. 8. Test hit, miss, expiry, race, eviction, offline, upgrade, and cross-account isolation. 9. Measure latency benefit, correctness, storage, and stale-result frequency. ## Guardrails - Never reuse private cached data across identities or tenants. - Cache presence does not grant current authorization. - Avoid indefinite stale fallback for consequential decisions. ## Done - A client cache policy report documents keys, freshness, lifecycle, and isolation - Race, expiry, offline, migration, and account-transition cases are tested - Cached, network, and visible state reconcile
在 GitHub 查看