hurshi / dio-http-cache

http cache lib for Flutter dio like RxCache
Apache License 2.0
274 stars 223 forks source link

[Question] forceRefresh on config object ? #38

Closed fvisticot closed 4 years ago

fvisticot commented 4 years ago

I would like to use this option as "defaultConfig" buildCacheOptions(Duration(days: 7), forceRefresh: true)

I do not see the forceRefresh property in the CacheConfig object ? Is it possible or do we need to buildCacheOption for each request requiring forceRefresh to true ?

hurshi commented 4 years ago

Hi, Thanks for your issue. I don’t understand what scenario you have created such a demand, if you need to forceRefresh every time, why use this library? I guess you want to get fresh data every time, but if you disconnect from the Internet, you can get the old data instead of reporting an error, if so, you can use buildCacheOptions(Duration(days: 0)) to achieve it. Anyway, welcome to discuss here 😄