express-request-proxy icon indicating copy to clipboard operation
express-request-proxy copied to clipboard

Partial response of 16KB with redis cache.

Open ankiit opened this issue 8 years ago • 4 comments

I've started facing following error for api response size > 16KB when using redis as a cache. And it ends up returning partial data of 16KB. with following log. Error: stream.push() after EOF at readableAddChunk (_stream_readable.js:156:17) at RedisRStream.Readable.push (_stream_readable.js:134:10)

ankiit avatar May 25 '17 14:05 ankiit

@ankiit Have you found any workaround for this issue?

ikappas avatar Jan 25 '18 13:01 ikappas

I'm using the older version of redis-stream.

ankiit avatar Jan 27 '18 07:01 ankiit

@ankiit I seem to have solved my issue.

When calling redis.createClient I had to add the detect_buffers: true option.

According to the redis-rstream readme under usage:

...Be sure to enable an option in your redis client to return Buffers for the data, like detect_buffers: true so that binary data will be read properly...

ikappas avatar Feb 07 '18 15:02 ikappas

This worked for me until I tried to use a transform. I was only getting 16kb back from redis, I enabled detect_buffers and I get the full response back. Now when I try to use the tranform, the chunk is only 16kb.

edit: I figured it out. I looked at the markdown example a bit closer and noticed they were using object mode and realized I needed to add the chunks together.

busheezy avatar Nov 29 '18 22:11 busheezy