Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改進Helper Cache方式 #203

Open
takidog opened this issue Sep 13, 2021 · 1 comment
Open

改進Helper Cache方式 #203

takidog opened this issue Sep 13, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@takidog
Copy link
Member

takidog commented Sep 13, 2021

目前使用的Cache lib
https://github.com/hurshi/dio-http-cache
並不能全部支援dio: ^4.0.0

導致無法正確cache Uint8List (Raw response body)
再導致無法使用clearTransEncoding

Dio官方有新增Cache方法的interceptor

https://github.com/flutterchina/dio/blob/master/example/custom_cache_interceptor.dart

可以從這邊替代

改進方向

  • 使用Dio官方的Cache interceptor example 替換原有的dio-http-cache

或是

  • 改用Hive 或其他資料庫,直接Cache結果

或是

讓學校把他不合RFC規範的__東西移除掉,把Transfer-Encoding 不合時宜的東西拔了

@takidog takidog added enhancement New feature or request help wanted Extra attention is needed labels Sep 13, 2021
@abc873693 abc873693 self-assigned this Sep 16, 2022
@abc873693 abc873693 added this to the v3.10.0 milestone Sep 16, 2022
@abc873693 abc873693 removed their assignment Sep 16, 2022
@abc873693
Copy link
Member

目前使用的Cache lib https://github.com/hurshi/dio-http-cache 並不能全部支援dio: ^4.0.0

導致無法正確cache Uint8List (Raw response body) 再導致無法使用clearTransEncoding

Dio官方有新增Cache方法的interceptor

https://github.com/flutterchina/dio/blob/master/example/custom_cache_interceptor.dart

可以從這邊替代

改進方向

  • 使用Dio官方的Cache interceptor example 替換原有的dio-http-cache

或是

  • 改用Hive 或其他資料庫,直接Cache結果

或是

讓學校把他不合RFC規範的__東西移除掉,把Transfer-Encoding 不合時宜的東西拔了

dio 官方的新路徑
https://github.com/flutterchina/dio/blob/master/example/lib/custom_cache_interceptor.dart

@abc873693 abc873693 modified the milestones: v3.10.0, v3.11.0 Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants