You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running into some strange issues that I'm having a hard time tracking down, I'm wondering if anyone else has encountered something similar. This issue is present with the port and the built in HttpResponseCache.
I'm making a series of api calls to my server and they are being cached so the next time the user loads a portion of the app the cached response is used. It works very well, but there are a few times when the response does not get cached (This is not a max cache size issue, the cache is initialized at 10mb and the responses are a few hundred k of json and they are not cached even when the cache is empy).
It seems like it is related to the size of the response as when I reduce the number of records I'm returning from the server the response is successfully cached and when I step the number of results up there is a point when it stops caching. One response is 7.83k and it is successfully cached, but increasing the number of results in the response which results in a 17.6k response results in a failure to cache. To make it even more complicated, on an older device it is happening more often.
I'm not familiar with DiskLruCache, but is this a device memory issue?
Activity
DanielLukic commentedon Mar 10, 2013
See if the server uses gzip as content-encoding and chunked as transfer-encoding. You might have this problem:
#33
Try removing the available() check in line 68 of ChunkedInputStream and see if that fixes your problem.
(See different behavior, depending on the response size, could indicate chunked/non-chunked transfer encoding being used..)
lkorth commentedon Mar 11, 2013
Great job, after removing the .available() check I am unable to reproduce my cache misses.