Comments (3)
Hi,非常感谢你的提问
- 这个拦截器是由 Dio 提供的,只要是同一个 Dio 实例,设置过这个拦截器,之后都会调用这个拦截器;但是调用了拦截器并不意味着就缓存接口了,要对某个接口进行缓存必须显示地调用
options: buildCacheOptions...
,所以这里没有所谓的全局缓存策略,只能为每个接口单独设置。 - 和 baseUrl 没有关系,baseUrl 是参数是可选的。对于 dio-http-cache 来说,baseUrl 是 key 的组成部分。
- 暂时没有对请求类型做过滤。
其他
- 全局缓存策略这个功能看上去的确有存在的必要,但我个人觉得也没有那么必要吧,毕竟缓存的接口相对于所有接口一般只是占一小部分,设置了全局缓存后,必须为每个不需要缓存的接口显示地设置跳过缓存。
- 欢迎提出你的想法,共同交流才能使 dio-http-cache 更好用。
from dio-http-cache.
@hurshi 很感谢你的回复 扫清了我的疑惑 其实目前 dio-http-cache 只是一个单纯的数据缓存库。即实现了强制缓存 并没有完整实现http缓存机制 (比如对比缓存(缓存校验))因此目前我们接口如果返回304状态码应该也是不支持的对吧?
from dio-http-cache.
对的,的确没有完整实现 http 缓存机制。
但是这里也有初步的实现,比如 maxAge, maxStale 等
from dio-http-cache.
Related Issues (20)
- if the internet is cut off and I display the data from the cache. I cannot manually delete
- Support on error callback
- Update the dependencies HOT 1
- Any example on cipher to encrypt cache? HOT 2
- at .wrapDatabaseException(.java:11)
- incompatible with newer dependencies HOT 2
- remove date when logout HOT 1
- Is this open source library?? HOT 1
- please add windows support HOT 1
- Json Serializable HOT 4
- Please add feature like getFileCached
- 建议
- Solving version fail HOT 6
- Change of copyright notice
- How I can disable this plugin for non Android / IOS / MACOS apps HOT 2
- [ Updated dependencies && Other pub.dev libs compatibility ] HOT 2
- Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast HOT 2
- Version Update HOT 6
- Updated the library to work with the latest DIO HOT 4
- Unhandled Exception: DatabaseException HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dio-http-cache.