Proposal to support all platforms (including web) while emulating browser caching behavior
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 22/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- dart, flutter
- Domain
- databases, mobile-dev, web-dev
Research direction
Start by reading the linked http_get_cache project and the proposal's references to Drift, sqflite, and fetch_client. Compare the intended Cache-Control, ETag, Last-Modified, revalidation, eviction, and platform-storage behavior, then verify that the native and web platforms are covered by tests for the expected browser behavior.
Written by the indexing model from the issue text.
Description
🏗 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)
- 📱 iOS
- 🤖 Android
- [+] MacOS
- [+] Windows
- [+] Linux
- [+] Web
- [+] Dart native
- Dominant language
- Dart
- Stars
- 810
- Forks
- 510
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Baseflow/flutter_cache_manager
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Baseflow/flutter_cache_manager#450 · 9 comments · 8 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
Baseflow/flutter_cache_manager#507 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
Baseflow/flutter_cache_manager#501 · 1 comment · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Baseflow/flutter_cache_manager#500 · 1 comment · 3 reactions ·
All issues in Baseflow/flutter_cache_manager
Similar issues
-
ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
error Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Bug Flutter User Feedbacks
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-dart#4042 · 1 comment ·
-
team-infra
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100