kwhitley / apicache

Simple API-caching middleware for Express/Node.
MIT License
1.23k stars 192 forks source link

ioredis client does not expose property `connected` #204

Open bjorndown opened 4 years ago

bjorndown commented 4 years ago

We are trying to use apicache with an ioredis client, but we don't see any keys in redis. It seems that the check introduced with https://github.com/kwhitley/apicache/commit/375ccc7edf6b8a066a75907d888f857238e020c4 does not work for ioredis because its client does not expose a connected property.

When I monkey-patch the connected property, I can see cache keys in redis.

ioredis sends connection events (https://github.com/luin/ioredis#connection-events).

jackluo commented 4 years ago

Second this issue

neilhem commented 4 years ago

Confirm, using ioredis as redis sentinel client do not save cached value to the Redis

rosslavery commented 3 years ago

Also experiencing this -- had to downgrade to 1.5.1 to fix it in the meantime.

sidgujrathi commented 3 years ago

Checked and confirmed with ^1.5.3, Second this issue 👍

lukebelbina commented 1 year ago

Confirmed that apicache was not working with ioredis for version 1.5.3, downgrading to 1.51 fixed it.