Force cache invalidation on API version change
还没有人认领这个 Issue。
评估
调研方向
首先追踪 Retrofit 缓存的存储方式以及 API 版本的检测位置。确定当前版本的持久化方式,然后验证检测到版本变化时,缓存会失效,而无需消费者公开 API 版本;issue 中提到的拟议 KeyValueStorage 接口是其中一个选项。
由索引模型根据 Issue 内容生成。
描述
Issue Summary
When the API version changes, the cache is not cleared. This creates a potential for serialization crashes due to changes in object representations.
Suggested Improvements
Since the API version is no longer exposed to the library consumer, we should invalidate the retrofit cache when we detect an API version change internally. This will require us to persist the current version of the API to disk. We should do this either using a flat file (since this is a java library) or force the consumer to provide an implementation of an interface that writes and retrieves key value pairs to disk.
interface KeyValueStorage {
fun storeStringForKey(key: String, value: String?)
fun retrieveStringForKey(key: String): String?
}
Then we will force cache invalidation any time we detect a change in the API Version.
- 主要语言
- Kotlin
- 星标
- 128
- 派生
- 48
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vimeo/vimeo-networking-java 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 42/100
vimeo/vimeo-networking-java#633 ·
-
难度 2/5 1-3 小时 新手友好度 20/100
vimeo/vimeo-networking-java#632 ·
-
难度 4/5 3-5 天 新手友好度 30/100
vimeo/vimeo-networking-java#613 ·
-
难度 4/5 3-5 天 新手友好度 20/100
vimeo/vimeo-networking-java#579 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
vimeo/vimeo-networking-java#572 · 1 个 reaction ·
查看 vimeo/vimeo-networking-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 3 天内回复
-
afk-ok area:ci size:S
难度 2/5 1-3 小时 新手友好度 83/100
enorm-labs/event-junkie#4518 ·
维护者通常 1 天内回复
-
android:player
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
confluentinc/intellij#670 · 1 条评论 ·
维护者通常 9 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
NucleusFramework/Nucleus#912 ·
维护者通常 1 天内回复