dio_cache_interceptor icon indicating copy to clipboard operation
dio_cache_interceptor copied to clipboard

Suggest to use HTTP 200 instead of 304 for the cached response

Open ShengChangYang opened this issue 11 months ago • 1 comments

Thanks for this great project first.

I would like to use the v3.5.0 to handle the HTTP 304 case, but I got a HTTP 304 (cached) response. By the RFC 2616, a HTTP 304 response MUST NOT contain a message-body. https://github.com/llfbandit/dio_cache_interceptor/blob/c73e8950fc98ae2924b6d4169c3ff2c6d9819466/dio_cache_interceptor/lib/src/model/cache_response.dart#L81-L89

IMO, I suggest to use HTTP 200 for this case. Thank you.

ShengChangYang avatar Feb 26 '24 07:02 ShengChangYang

Just found there had the same opinion before. https://github.com/llfbandit/dio_cache_interceptor/issues/141#issuecomment-1823594643

ShengChangYang avatar Feb 26 '24 08:02 ShengChangYang