See line 68 in ChunkedInputStream:
if (bytesRemainingInChunk == 0 && in.available() >= MIN_LAST_CHUNK_LENGTH) {
Using available() on an InputStream is generally a bad idea, I guess. In many cases this will return 0.
In case of a server returning gzipped data (content-encoding: gzip) of more than a few KB, it will probably turn on chunked encoding (transfer-encoding: chunked). Most probably to support non-buffered streaming mode.
In this case the ChunkedInputStream will never commit the response data to the cache.
The easy fix is probably to reduce the if statement in line 68 to:
if (bytesRemainingInChunk == 0) {
Does that make sense to anyone? ^^
Cheers,
dl