llfbandit / dio_cache_interceptor

Dio HTTP cache interceptor with multiple stores respecting HTTP directives (ETag, Last-Modified, Cache-Control) with options.
https://pub.dev/packages/dio_cache_interceptor
120 stars 70 forks source link

Multi-layer caches #162

Closed vgodara closed 2 months ago

vgodara commented 2 months ago

I am trying to use multiple Cache interceptor one which is persistence and request based second is in memory but forced. I wanted to know the reason behind the following line of code in DioCacheInterceptor Line no 170 in method call _shouldSkip

llfbandit commented 2 months ago

I suggest you to use BackupCacheStore with MemCacheStore for a volatile cache and another one for persistence. Those two stores are available from dio_cache_interceptor package.

By the way, mixing behaviours, seems a very wrong path.

vgodara commented 2 months ago

Got it man. Thanks for the help. I am just using it for one api . It suppose to be Cache control max age but since we can't decide on the age I am just storing the data in memory for the session