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
119 stars 70 forks source link

Feature Request: Don't save on cache where Response.data is null #125

Closed Willian199 closed 1 year ago

Willian199 commented 1 year ago

Make possible to configure if when Reponse.data is null it should be saved or not.

Because in my case, if the value was null, the next request must call again.

Obs: If ResponseType is plain, it throws "type 'Null' is not a subtype of type 'String'", maybe a bug? If ResponseType is json, when executing serializeContent it will parse a null value to a String with "null" as literal.

llfbandit commented 1 year ago

This is not responsability of this package. You can create and set another interceptor before (or top of it) to handle this specific behaviour.