Baseflow / Baseflow/flutter_cache_manager
Proposal to support all platforms (including web) while emulating browser caching behavior
- 主要语言
- Dart
- 星标
- 809
- 派生
- 510
- 平均合并
- 6 分钟
- 30 天内合并 PR
- 1
描述
## 🏗 Enhancement Proposal
I recently was able to support all native platforms and web with an emulation of how the browser works with saving, revalidating and evicting cache.
https://github.com/rodydavis/http_get_cache
The goal is to support the same way the browser does caching:
- Cache-Control, eTag, Last-Modified headers
- max-age, stale-while-revalidate, stale-if-error, only-if-cached
- Support fetching content updates with head requests for non immutable objects and only after stale and 304 response meaning no update
- Support skipping cache with request headers: no-cache
- Support preventing storing with: no-store
- Use platform cache directory for stored files and database in documents
### Pitch
- Update core logic to use Drift instead of sqflite to support all native platforms
- Web will use the fetch_client package and work with browser caching
- New http client for wrapping network requests
- Add tests to test for expected browser behavior
### Platforms affected (mark all that apply)
- [X] :iphone: iOS
- [X] :robot: Android
- [+] MacOS
- [+] Windows
- [+] Linux
- [+] Web
- [+] Dart native
贡献指南
调研方向
首先阅读链接的 http_get_cache 项目,以及提案中对 Drift、sqflite 和 fetch_client 的引用。比较 Cache-Control、ETag、Last-Modified、重新验证、驱逐和平台存储的预期行为,然后验证 native 和 web 平台是否都有针对预期浏览器行为的测试覆盖。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- dart, flutter
- 领域
- databases, mobile-dev, web-dev
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 22/100